havenswift-hosting Posted December 18, 2014 Share Posted December 18, 2014 HiJust come across a problem when enabling the store wide Global Percentage Discount Sales Mode when using the Vector skin (actually to be more accurate when the Fusion plugin that is required for ShopDev's Vector and Blueprint skins is enabled).If you enter 30 as a global percentage discount on all products, then the price is displayed correctly on the product page, category page and also in the sale items and popular products side boxes but the Latest Products all display 0.00 (which isnt the sale price for each specific product as tried manually setting that and that price either).Interestingly, even if you switch to using another skin (tested with several standard skins) but leave the Fusion plugin enabled, the same behaviour happens - in order to get global sales pricing working even on a standard skin, you need to disabled the Fusion plugin !This is using latest 5.2.14 CubeCart along with the "latest" (obviously been no updates in a while) versions of Vector and Fusion.Has anyone else using Vector experienced this or does nobody else use the global sale discount mode.ThanksIan Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 18, 2014 Share Posted December 18, 2014 Yes, there is another conversation that is complaining about the prices of sale items in one of the boxes. '?do=embed' frameborder='0' data-embedContent>> Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 18, 2014 Share Posted December 18, 2014 In this class (Product_Listing), the standardize() function gets the complete inventory record and has the existing product data merged into it. Then the setPrices() function is called. This class is not a Singleton so each time it is instantiated, a whole new private set of variablwes gets created with it, meaning there should not be any cross-contamination of working variables. CubeCart does not bring prices into the Popular Products array of inventory, so standardize() will fill that gap. (But this does nothing to adjust prices for customer groups.) The fact that only sale_prices are affected is interesting, and that only one box is affected. All boxes and homepage use the same sequence: standardize() then setPrices(). The fact that your Latest Products is affected, while the other complaint is affecting Popular Products is also interesting. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 18, 2014 Share Posted December 18, 2014 setPrices() works only with the inventory record's sale_price and does not calculate a sale_price in any other fashion. What we can try to do is replace the code in setPrice() with a call to Catalogue->getProductPrice(). Or maybe replace most of the code in standardize() with a call to Catalogue->productAssign(). Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 18, 2014 Share Posted December 18, 2014 I use Blueprint and had no problem the last time I used a Global % Sale, other than showing Out of Stock items with a Sale Price lol. My Blueprint is far from stock, though. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 19, 2014 Share Posted December 19, 2014 "The Latest Products all display 0.00 (which isn't the sale price for each specific product as tried manually setting that and that price either)." I'm confused about the phrasing of the last few words. I said: "The standardize() function gets the complete inventory record and has the existing product data merged onto it." Thus, it is assumed CubeCart has already calculated whatever price/sale_price the customer is entitled to -- if the box has prices made available to it. As I indicated, the Popular Products box has only name, product_id, quantity, and url available. Then when the complete record is received from the query, we now have price and sale_price. I've copied the code of a couple of the Fusion hooks, class.gui.display_popular_products.php and class.cubecart.display_homepage.php, into snippets, and also copied the product_listing.class.php to /classes/, and I get no errors. I do get plenty more information in Smarty's Debug Console for each product in the appropriate skin template variable, so I know the hooks are working. And all the data is correct. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 19, 2014 Share Posted December 19, 2014 Do you have Turbo installed as well? If so, I did have to disable all the javascript related compression choices. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 19, 2014 Share Posted December 19, 2014 No turbo. Please realize that by moving the code the way I did, I was able to simulate how just these hooks would behave in a normal Fusion installation. I do not have any of the skins installed. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 20, 2014 Author Share Posted December 20, 2014 Hi Sorry for delay in responding to this thread and thanks for the various contributions so far although I am not any closer to working out why the sale price is incorrect in these circumstances Do you have Turbo installed as well? If so, I did have to disable all the javascript related compression choices. Turbo should never be used with Vector skin - it is completely incompatible and should only be used with Blueprint although even then it is far better to manually control the functionality that this plugin adds yourself. Personally I would uninstall Turbo from any and all sites. I use Blueprint and had no problem the last time I used a Global % Sale, other than showing Out of Stock items with a Sale Price lol. My Blueprint is far from stock, though. This specific problem happens only on Vector although it has been reported that there are similar but different issues with Blueprint but have not seen these myself. "The Latest Products all display 0.00 (which isn't the sale price for each specific product as tried manually setting that and that price either)." I'm confused about the phrasing of the last few words. I was simply confirming that it is the calculation of the sale price to include the global discount perecentage that is incorrect with all products returning 0.00 as opposed to it displaying what is currently held in the sale_price column for each product I said:"The standardize() function gets the complete inventory record and has the existing product data merged onto it." Thus, it is assumed CubeCart has already calculated whatever price/sale_price the customer is entitled to -- if the box has prices made available to it. As I indicated, the Popular Products box has only name, product_id, quantity, and url available As I said in the OP, the Popular product pricing (along with almost every other pricing) is correct - it is only the sale price for the Latest Products that always displays 0.00 under these circumstances. If you are happy to take a look at a dev site where I can reproduce this, then happy to give you access - if you drop me an email,happy to do that Thanks Ian Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 21, 2014 Share Posted December 21, 2014 Haven-swift's issue seems to have been an edit to a Fusion hook that inadvertently zeroed-out the sale price. A different approach to that edit was implemented and further testing is required. But, since Blueprint also uses Fusion and its hooks, I do not know why the effect was not seen on that skin. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 21, 2014 Share Posted December 21, 2014 If I can share any Blueprint files you think might be helpful, I'll be glad to. Sometime ago a CC update messed up my Blueprint, and a developer fixed it for me. I just double checked, and our Blueprint store quickly correctly changes to and from Global % Sale. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted December 27, 2014 Author Share Posted December 27, 2014 Hi It turns out that one of last changes that the shopdev developer made (about a year ago when he was still around) was supposed to be a fix to a file within the Fusion plugin for a problem with Latest Product sale prices but actually caused more problems than it solved. The file was part of the standard Fusion distribution for a while although that change appears to then have been withdrawn as it is no longer in the zip distribution file. Brian has added some more robust and this now works perfectly in all tests we have conducted Ian Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.