Jump to content

[Resolved] v6.10 No Longer Accepts 0 for Sale Items to Display?


bubbaboss

Recommended Posts

I'll look at this, but for the moment, switch the store's "Sale Mode" to Disabled.

But I think you actually may want to have some store sales, so that is not a solution.

Maybe remove {include file='templates/box.sale_items.php'} from the main.php template?

Link to comment
Share on other sites

OK.. i will try your temp code fix..

I upgraded 4 sites and they all did the same... 0 is not recognized? as it was before.

I USE GLOBAL SALE .... but i don't like to show that list since everything is on sale.

IT WAS WORKING FINE IN VERSION v6.09 upgrade from prior...

Thanks

Link to comment
Share on other sites

Yes, a fix was implemented when the admin entry was left blank.

Unfortunately, the fix went a bit too far. It fixed the entry if that entry was false-like, including zero, instead of checking for just a blank.

There is a hook in the code that develops the contents for the Sale Items box, so we cannot simply abort the whole thing if the number of sale items to show suggests zero.

In CC6010, /classes/gui.class.php:

Line 1193:

$no_sale_items = ($GLOBALS['config']->get('config', 'catalogue_sale_items') > 0) ? $GLOBALS['config']->get('config', 'catalogue_sale_items') : 10;

Change to:

$no_sale_items = (is_numeric($GLOBALS['config']->get('config', 'catalogue_sale_items'))) ? (int)$GLOBALS['config']->get('config', 'catalogue_sale_items') : 10;


Line 1195:

if (isset($sale_sql_standard_select) && ($standard_pricing = $GLOBALS['db']->query('SELECT `price`, `sale_price`, `product_id`,`description`,`name`, '.$sale_sql_standard_select.' AS `saving` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` WHERE '.$sale_sql_standard_where.' AND `status` = \'1\' '.$not_on_sale.' LIMIT '.$no_sale_items)) !== false && is_array($standard_pricing)) {

Change to:

if ($no_sale_items && isset($sale_sql_standard_select) && ($standard_pricing = $GLOBALS['db']->query('SELECT `price`, `sale_price`, `product_id`,`description`,`name`, '.$sale_sql_standard_select.' AS `saving` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_inventory` WHERE '.$sale_sql_standard_where.' AND `status` = \'1\' '.$not_on_sale.' LIMIT '.$no_sale_items)) !== false && is_array($standard_pricing)) {

 

Link to comment
Share on other sites

This github issue suggests it has been reopened. I notice, however, the milestone target for it has not been updated, and that the milestone CC6.0.10 has been closed but not completed. (I don't know what that implies.)

I am in no position to confirm or deny anything. I can, however, infer with great certainty that this will be implemented in CC6.0.11.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...