Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Update cart only on shopping cart page

Update cart only on shopping cart page

Started by mesnitu on 16 May 2016, 10:40 AM · Views: 582

Results 1 to 4 of 4
16 May 2016, 10:40 AM
#1
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Post #1 by mesnitu

Hi
Hope someone can en-light me on this one:

ON v151 I had the qty box in the product info page.
On this new version, I want to remove it, and so I did like this:

I guess this one should be set to 1 ( configuration->productInfo)

Product Quantity Box Status - Adding New Products = 1

And in the layout product type:

**Show Quantity in Shopping Cart = 0 **

Then I updated all products

UPDATE products SET products_qty_box_status=0 WHERE products_qty_box_status=1

Ok, So in product info page (actually I'm using the bookx product type, but the option is the same ), the quantity boxes are off.
Cool !

But on the shopping cart page , I think, or I wanted that a customer could update the qty....just there.
There's a column for the update, but only with a input hidden field....

Is this possible ? Or to have this quantity update on main_page shopping cart, I also must have the boxes in the product info page ?

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

16 May 2016, 12:41 PM
#2
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Post #2 by mesnitu

well, just remember that probably the simple way, is just to hide it with css....
Not sure if there's a "formal" way to do it, but in the mean time, I've done so.

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

16 May 2016, 2:26 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #3 by mc12345678

You can also modify the data that forces the shopping cart to display without the ability to modify the cart quantity.

Either in: includes/modules/pages/shopping_cart/header_php.php you can modify this line:

$showFixedQuantity = (($show_products_quantity_max == 1 or zen_get_products_qty_box_status($products[$i]['id']) == 0) ? true : false);

To something like:

$showFixedQuantity = (($show_products_quantity_max == 1 /*or zen_get_products_qty_box_status($products[$i]['id']) == 0*/) ? true : false);

Or you can use the closing/end notifier to modify the associated variable ($productsArray and either or both of its two array values) to be set by the associated logic.

Alternatively, you could modify includes/templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php to always display the desired edit field for updating. I would suggest that either of the first two options be considered and then in the effort to minimize core file edits, might suggest developing the observer to listen to the end of header notifier and work on the value(s) as seen fit for your condition(s).

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

16 May 2016, 2:31 PM
#4
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Post #4 by mesnitu

Thanks for the reply !

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison