Totally Zenned
- Join Date:
- Jul 2012
- Posts:
- 16,908
- Plugin Contributions:
- 2
Stock by Attribute v4.0 addon for v1.3.5-1.3.9
simon1066:
This may be a bug/omission but given the complexities of this mod I wouldn't be surprised if I just didn't understand.
When adding a product to the cart my config settings are such that the cart is not displayed and I instead get a popup saying for example:
'Men's Red Shoe' was added to your basket
>
> If I do the same with a product priced by attributes and SBA, I get:
>
> ```html
was added to your basket
eventually I found that in includes\extra_cart_actions\stock_by_attributes.php
around line 1064
// display message if all is good and not on shopping_cart page
if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) {
$messageStack->add_session('header', ($_SESSION['cart']->display_debug_messages ? 'FUNCTION ' . FUNCTION . ': ' : '') . SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
>
> needed to be changed to
> ```
// display message if all is good and not on shopping_cart page
if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) {
$messageStack->add_session('header', ($_SESSION['cart']->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . '\'' . zen_get_products_name($_POST['products_id']) . '\'' . SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
so that the zen_get_products_name function is called when adding a 'SBA' product to the cart.
Haven't yet dug into the likely cause for the "difference", but could you identify the version of ZC in which this occurred and any other plugins that may be associated? I'm curious if there is an issue with loading sequence of the define or some other information that might cause that minor difference (ie. If perhaps there was a change in the shopping_cart class that did not get picked up into the extra_cart_actions file.)