Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there.

    I’ve done overriding cart.php rather than build this in plugin. In cart item loop, I duplicate the loop based on quantity number.

    if( $cart_item['quantity'] > 1 ):
    
    	$qty_range = range(1, $cart_item['quantity']);
    
    	foreach ($qty_range as $range) {
             // Duplicate cart item if its quantity more than 1
            }
    else :
    
    // Cart item if quantity equals to 1
    
    endif;

    It is what I have on my cart page.

    Here is my complete cart.php

    I hope it gives you a clue.

    Thread Starter yogesh.patel.thesslstore

    (@yogeshpatelthesslstore)

    Hi Kharis,

    Thank you very much for you support but my plugin has a other functionality too, so i want to integrate with it using any hooks.
    My concern is create individual entry in database too for every line item not only show in front end.

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create new line item for quantity in cart’ is closed to new replies.