Jump to content

Sale items not appearing in Sale Items category


DavePace

Recommended Posts

Since upgrading to version 6.5.2 we have the following issue:

For reference our shop is located at https://www.airbornesappers.org.uk/shop/index.php

We do have products with a Sale price entered, which are less than retail and greater than zero

In Store Settings - Features we have Sales Mode set to Per Product, with Number of sale items to display set to 20

I don't know if the upgrade to 6.5.2 has caused this, all I can say is that prior to the upgrade Sale Items were displayed in the Sale Items category

I've searched other topics and checked as much as I know what to check but can't fix this error

Any help appreciated

Thank you

  • Like 1
Link to comment
Share on other sites

Using a programmer's text editor, please make this edit. In /classes/catalogue.class.php, near line 893:

From:

$GLOBALS['catalogue']->searchCatalogue((int)$_GET['cat_id'], $page, $catalogue_products_per_page);

To:

$GLOBALS['catalogue']->searchCatalogue($_GET['cat_id'], $page, $catalogue_products_per_page);

The variable $_GET['cat_id'] could actually contain the value 'sale'. Should this text value be cast to a numerical type, it equals 0, for which there is nothing to be found.

The use of (int) was added in an attempt to solve some other problem.

  • Like 1
Link to comment
Share on other sites

Hi and thank you for your quick reply

I tried to make the change you suggested by opening the file in code view in Dreamweaver, but I couldn't find the text line you mentioned.  I even looked for parts of the text usin CTRL + F but still not found in /classes/catalogue.class.php

Any further help welcome

Thank you

Link to comment
Share on other sites

Wow! Really messed that one up. It's in /classes/cubecart.class.php, line 893.

Note: I would discourage using DreamWeaver to edit PHP code files. I do not know about the latest versions, but earlier versions insisted on prepending the "byte-order-mark" to files -- which will cause strange errors.

Edited by bsmither
Link to comment
Share on other sites

Having looked into the DreamWeaver BOM issue, it seems that, if the documentation agrees with the version of DreamWeaver you are using, there is a default setting that can be established for when one is editing a PHP code file. Also, each editing session can have some sort of document properties set for that session.

 

Link to comment
Share on other sites

Hi

I've made the change to cubecart.class.php and all is now working prefectly i.e. all sale items are appearing in the corresponding category

I downloaded Notepad++ to edit the file, which has done the job perfectly, nice simple programme.  Should also take away any concerns that Dreamweaver might be doing some odd things that aren't obvious

Thank you for your help, very much appreciated

Link to comment
Share on other sites

On 10/12/2023 at 9:38 AM, cqpbert said:

notepad ++ is awesome for almost all things text related IMHO.

Just my $.02

I don't know PHP, I just make minor edits to fix the sort of issues detailed in this thread, but good to know I picked an editor that's up to the job.  I found it very easy to use, no fuss, no frills just a nice clean, simple program.

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...