VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: websmith on October 21, 2016, 13:47:57 PM

Title: Base price showing in product details page but not in cart
Post by: websmith on October 21, 2016, 13:47:57 PM
Joomla 3.6 VM 3.0.18

Just notice after updating to the VM 3,0.18 that the cart is not displaying the base price or msrp. In product details page I have the following

MSRP 73

Sale Price 53

Discount 25.


This is good. When I add to cart it shows

Price 53

Sales Price 53

Discount 25

I tried changing various settings in configuration / pricing tab but to no avail. I even disabled the One Page Checkout plugin and and used core VM cart and still same issue.

Im a little bleary eyed over this and sure its a simple fix. Any help would be appreciated.

Title: Re: Base price showing in product details page but not in cart
Post by: K&K media production on October 21, 2016, 17:12:32 PM
You're using template overrides. Please try it without your overrides. Maybe you have to adjust your overrides for vm 3.0.18.

If you've bought your template, please ask your template developer for a new version.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 21, 2016, 18:24:08 PM
Template is protostar.
The cart seems to be pulling the price with this:
<span class="PricediscountedPriceWithoutTax">
That price should be Base price or MSRP, not discounted.

How and where could this be changed or updated? Odd how the product details page shows correct pricing but the cart is pulling different pricing fields?
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 24, 2016, 02:52:07 AM
I tried adjusting every override I could think of and find and nothing affects the base price.
I did check the product pricing and information page in the Virtuemart Admin panel and the final price overwrite "final price override" seems to be the issue.

I need to have the final price overwrite available to reflect the new pricing and discounts. Any idea on how to overcome this problem with this new information? Ive attached a screencap to show what Im referring to in admin panel. Thanks again.
Title: Re: Base price showing in product details page but not in cart
Post by: jenkinhill on October 24, 2016, 13:34:49 PM
It really does look like you are using template overrides (but you have not provided a URL) and maybe a one page checkout plugin.  If using overrides with Protostar the they will be in /templates/protostar/html/com_virtuemart/  if you rename that directory to com_virtuemart_ then it will not be used and will use VM default templates by default. For a one page checkout this can be disabled by unpublishing the plugin. 

It is simple steps like this that enable the cause of issues to be identified.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 24, 2016, 14:57:42 PM
Thank you Jenkinhill for the insight. I have renamed the templates/protostar/html/com_virtuemart to templates/protostar/html/_com_virtuemart

I disabled the vmone page checkout, and the problem is still there using virtuemart core cart.

I am using alatak ups shipping and alatak cc offline processing. I dont think they would have anything to do with core cart file pricing but mentioning just in case.

I did import products using csvi updated and have final price with override in product info page. One thing I did notice was I didnt have a com_vurtuemart folder in template/html/ directory until I upgraded to 3.0.18.

Is there any other place to look into that an override can take place like this? Thanks again for your time and help.
Title: Re: Base price showing in product details page but not in cart
Post by: kishoreonwork on October 24, 2016, 15:53:19 PM

Can you enable debug mode and post the result ? Debugging mode can be enabled by going to Configuration ->Advanced Settings ->Enable debugging messages & PHP Developer mode

Thanks
Kishore
Title: Re: Base price showing in product details page but not in cart
Post by: K&K media production on October 24, 2016, 16:17:00 PM
without any overrides and "override final price" enabled you should see something like the attached image
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 24, 2016, 16:33:39 PM
I have no overrides that I know of. My understanding is that the overrides would be in the templates/protostar/html/com_virtuemart folder. I didnt have a com_virtuemart folder in this path until I upgraded to 3.0.18.

I dont think I would have edited the template directly either. Ill try to compare an older version backup of the template file and see if anything stands out.

Heres the debug info. This is the first cart page after clicking add to cart from product details page. The variable order amount is incorrect. Its displaying the discounted amount, not final overwrite price setup in product information page.

Message

vmdebug PHP 5.4
vmdebug Show All Errors
vmdebug LangCount: 1 $siteLang: en-US self::$vmlangSef: en self::$_jpConfig->lang en_us DefLang en_gb
vmdebug vmTime: time to load config: 0.0162410736083984
vmdebug Start used Ram 12M
vmdebug getVendorId normal shopper
vmdebug Created new Calculator Instance
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10010 to 10014
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 (10003) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 (10003) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 (10003) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10003 to 10003
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 (10003) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10001) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10001) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10001) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10001 to 10001
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10001) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10002) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10002) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10002) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10002 to 10002
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10002) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10007) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10007) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10007) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10007 to 10007
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10007) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10009) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10009) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10009) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10009 to 10009
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10009) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10013) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10013) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10013) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10013 to 10013
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10013) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10016) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10016) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10016) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10016 to 10016
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10016) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10018) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10018) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10018) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10018 to 10018
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10018) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10038) = TRUE for variable weight = 11.0231131092439 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10038) = TRUE for variable order amount = 53.99 Reason: no boundary conditions set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10038) = FALSE for variable zip = 0 Reason: is NOT within Range of the condition from 10038 to 10038
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10038) = TRUE for variable virtuemart_country_id = 0, Reason: Countries in rule or none set
vmdebug getCCFromSession Var1:
0
vmdebug _getPluginNameInfo Var1:

vmdebug vmTime: Time consumed for shipment/payment plugins: 0.114715099334717
vmdebug Going to set core fields unrequired
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 7.99 (10003) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10001) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10002) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10007) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10009) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10013) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10016) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10018) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug shipmentmethod Flat Rate Same Day Delivery 9.99 (10038) = TRUE for variable virtuemart_country_id = 223, Reason: Countries in rule or none set
vmdebug calculateShipmentPrice $shipment INVALID set cart->virtuemart_shipmentmethod_id = 0 Var1:
5
vmdebug vmTime: Time consumed for shipment/payment plugins: 0.0154190063476562
vmdebug End used Ram 25.25M
vmdebug Peak memory peak 25.25M
vmdebug vmTime: vm view Finished task : 0.268929004669189
Title: Re: Base price showing in product details page but not in cart
Post by: jenkinhill on October 24, 2016, 17:44:09 PM
I think you are trying to give a 25$ discount to a product of base price 78.99$. You don't seem to be applying tax, so you should be applying a tax/calculation rule of -25$ to the base price as a Price modifier after tax,  giving a saleprice of 53.99$ 

This gives a default cart layout as seen in the image. I don't know how this will look in your one page checkout.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 24, 2016, 23:37:19 PM
Thanks Jenkinhill. Would this be the proper procedure for adding a discount and sale price?

I have over 400 products I would have to go through and update. Dreading that.

Would the next update release fix this or did I import pricing incorrectly? We used the csvI plugin.
Title: Re: Base price showing in product details page but not in cart
Post by: Milbo on October 25, 2016, 11:15:56 AM
Quote from: websmith on October 24, 2016, 14:57:42 PM
I did import products using csvi updated and have final price with override in product info page.

The override prices must be used with caution. They are not there for simple discounts. I wonder if it would be better to remove them.

Quote from: websmith on October 24, 2016, 14:57:42 PM
One thing I did notice was I didnt have a com_vurtuemart folder in template/html/ directory until I upgraded to 3.0.18. 

We do not create overrides. You must check, which template you use. Protostar was just an example.
Title: Re: Base price showing in product details page but not in cart
Post by: jenkinhill on October 25, 2016, 12:34:06 PM
Quote from: Milbo on October 25, 2016, 11:15:56 AM
The override prices must be used with caution. They are not there for simple discounts. I wonder if it would be better to remove them.

Price override is very useful when used correctly. So instead of removing the option maybe add some sort of "READ THE MANUAL" instruction.
Title: Re: Base price showing in product details page but not in cart
Post by: Milbo on October 25, 2016, 13:03:25 PM
right jenkinhill.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 25, 2016, 21:11:16 PM
The problem we face with using a tax to discount a price is that there is not a specific percentage to apply to all products to get the discounted price.

Each product has a unique formula to get a discount price, so entering final price in override seems to be the easiest option.

How do others apply discounts to hundreds or more products? Wouldn't using a spreadsheet and importing them make the most sense?
Title: Re: Base price showing in product details page but not in cart
Post by: jenkinhill on October 25, 2016, 23:07:48 PM
I have managed large sites using CSVI (https://csvimproved.com/) but if you are wanting to use a cash discount for each product then you need a tax/calc room for each of those values.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 25, 2016, 23:24:13 PM
So if I'm understanding you correctly, I need to create a tax/ Calc for each product to apply a discounted price? That would be over 400 tax/ Calc s for my situation.

That seems like an awful lot of extra work for a seemingly simple msrp price, discount amount and sales price.

Why can't it be to just enter msrp price and final price when adding products in product info panel? So much easier imho.

EDIT

I just created a tac/calc and this seemed to work. So is the following attachment correct? And is this the proper way to apply all discount pricing for present and future? I have to create a tax / calc for every product with a discount?

This seems terribly cumbersome. So if Im correct in my understanding, everytime a price change occurs, one has to change the base price in product info panel AND the tax/calc area if the amount or percentage of discount changes. Why not just leave the override and overwrite in product info panel so all updates can be done quickly in one area? Maybe Im missing the bigger picture or something, Im just not getting it.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 26, 2016, 03:13:28 AM
Quote from: jenkinhill on October 25, 2016, 23:07:48 PM
I have managed large sites using CSVI (https://csvimproved.com/) but if you are wanting to use a cash discount for each product then you need a tax/calc room for each of those values.

When importing using csvi do you have to create the tax/ calcs in virtuemart first or can they be imported as well?
Title: Re: Base price showing in product details page but not in cart
Post by: Jörgen on October 26, 2016, 07:21:03 AM
The way I am using discount is by creating hidden categories.

25% discount
50% discount
75% discount
summer sale
winter sale

To each of these categories I create a calculation rule with appropriate discount. By publishing and unpublishing I could place a product in both  in both Winter and summer sale. With the right one active I get the correct discount. There are probably other methods of doing this. But I like it this way.

More Reading
https://docs.virtuemart.net/manual/products-menu/taxes-and-calculation-rules.html (https://docs.virtuemart.net/manual/products-menu/taxes-and-calculation-rules.html)

regards

Jörgen @ Kreativ Fotografi
Title: Re: Base price showing in product details page but not in cart
Post by: jenkinhill on October 26, 2016, 10:23:56 AM
Quote from: websmith on October 26, 2016, 03:13:28 AM
When importing using csvi do you have to create the tax/ calcs in virtuemart first or can they be imported as well?

I have cretaed them manually - but then most sites only have a small number of rules. Like Jörgen I now use categories to appply multiple rules when required.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 26, 2016, 14:50:40 PM
Thank you very much for your replies and info. I have just over 400 products in store. The problem Im facing is that the owner is not using percentages that a good number of products will be sharing. Just the opposite. Most products have unique percentages of discounts.

For example, product A could have a $10 discount. Product B could have a $25.04 Discount. Product C could have a $2.01 discount. So when all is said and done I will have about 300 tac / calc rules that will have to be modified next pricing update. I cant imagine having 300 categories and keeping track of all the calculations as well.

So my procedure is to edit the product, see what the discount is, create a tax / calc, refresh the product page to reflect the tax / calc, apply tax / calc, then check appropriate overwrite. Seems such a daunting task compared to the override where you can just plugin the base price, sales price and check overwrite and your done.

It took hours last night to get through my "A" products and I already have 45 tax/calcs. Do you see how cumbersome this procedure is from my end?

I appreciate all the help and guidance you all have provided. I just wish there was a better way to apply these discounts. I know the owner is going to have a fit when I explain how to apply updates to pricing. Its not user friendly at all.

Final question, is the caution in using overrides due to them breaking at some point? Im still baffled as to why they worked prior to 3.0.18 update and now are broken?
Title: Re: Base price showing in product details page but not in cart
Post by: Jörgen on October 26, 2016, 15:02:39 PM
Hello

I am just curios on how the update of prices is done today. How does the customer set the discount? Does he change every Product price manually or does he have some kind of system. If this is done after some kind of system then the upadate into VM should be easy to do. I can not imagine that every product has a unique formula, how does he update these hundreds of formulas ? Updating with cleverly named catgories would not be so hard I think.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 26, 2016, 15:18:29 PM
I believe they use a spreadsheet. The problem is sometimes they get different discounts or promotions from vendors and they markup according to profit and competition pricing. So the sales price is never a set  formula as they could adjust it by pennies to be more competitive.
And this would be for every product. So imagine having to adjust a spreadsheet with hundreds of products, then you have to duplicate all that work again just to update your website! Should be an easy import sku, price name, base_price, discount_price and sales_price and your done. At least in my simple mind.

I used csvi improved to import all the products and pricing. We were planning on using the same procedure for future pricing updates, but this whole tax/calc through a major wrench into the works. To be honest, This could be a deal breaker as its much more work than a simple yahoo store. Id gladly use an older version of VM if I can use the overrides and just import csv files for pricing updates. So much easier and user friendly.

EDIT
The pricing worked great until something broke on the 3 0 18 update. IN the product info panel you add base price, sales price, override and overwrite final price and your done.
So what would cause the base price to show in the product details page and not the cart? Why would the cart pull the discounted price as the base price? Maybe thats the question that needs an answer if anyone knows.
Title: Re: Base price showing in product details page but not in cart
Post by: jenkinhill on October 27, 2016, 11:06:18 AM
You mention in the Joomla forum that you took this site over from another developer. I'm guessing that he/she had edited the cart template but not created an override, so after the 3.0.18 update the override was wiped out and replaced by the default file.  You are using the product pricing structure in a completely non-standard way, but here is a possible solution.

I assume that there are no profit or tax rules applied to the products. 
For each product enter the MRP or whatever you want to call it as the cost/final price. Then enter the selling price (ie cost price minus that product's discount) as an override.  Then in the product details you can display (after overriding language strings) MRP, discount and final selling price.

In order to get those to display as you want them in the cart you should edit and override the cart templates - the figures are all there.

The images show this using VM default templates and default language strings.

So all you need to enter for product prices are cost/MRP and final selling price. The discount value is automatically calculated.
Title: Re: Base price showing in product details page but not in cart
Post by: websmith on October 27, 2016, 22:13:49 PM
Thank you very much for your time and help Jenkinhill.