Hours: Monday - Friday 8am - 5pm
  • Billing Access
  • Project Management
  • News

infule

  • Home
  • Web Design
  • SEO
  • Services
    • PPC
    • E-Commerce
    • WordPress Web Design
    • Joomla Web Design
    • Web Hosting
  • Our System
  • Portfolio
  • Contact
1 (970) 639-0777

Virtuemart Price Doubles When Added To Cart

Virtuemart Fix Pricing Error

My Issue: On my Landscape Photography website I’m using Joomla for the Web Design, I’m trying to sell fine art prints through Virtuemart where I have Custom Fields setup for each print size. Example:

  • 8×10 Print – $85
  • 11×16 Print $120 etc

However, I have to have a base price setup in the product information tab in order to have the Add To Cart Button appear. My issue is, whenever I click on the custom field drop down and select 8×10, the custom field price of $85 get’s added to the original price.

I wanted the custom field price to change the product price and NOT add to it.

Here are our specs of installation as of this posting:

    • Joomla: 2.5.11 – 3.9.x
    • Virtuemart: 2.0.20b – 3.4.2

Here is the fix:

Go to: /administrator/components/com_virtuemart/helpers/calculationh.php

On Line 300 ( On Virtuemart 2.0.20b), Line 376 (VM 3.4.2) Change This code:


if (!empty($variant)) {
$basePriceShopCurrency = $basePriceShopCurrency + doubleval($variant);
$this->productPrices['basePrice'] = $this->productPrices['basePriceVariant'] = $basePriceShopCurrency;
}

Remove: $basePriceShopCurrency + to look like this:


if (!empty($variant)) {
$basePriceShopCurrency = doubleval($variant);
$this->productPrices['basePrice'] = $this->productPrices['basePriceVariant'] = $basePriceShopCurrency;
}

Additional – If you want to update the “+” symbol between the custom field text and price:

Go To: /administrator/com_virtuemart/models/customfields.php

On Line 973  (VM 2.0.20b), Line 907(VM 3.4.2) –

Change:  $price =”+”.$price;

Change the + to whatever you want it to be.

If you need any help with your Joomla or Virtuemart web design project, feel free to reach out. We’d love to help!

I hope that this helps! Please feel free to comment if you have any questions.

2 Comments to “ Virtuemart Price Doubles When Added To Cart”

  1. Mathew Benn says :Reply
    July 4, 2017 at 9:59 am

    Thanks a million! I was looking in the Virtuemart code forever to find out what was going on with my product pricing and why it was double when I went to checkout. This worked perfectly.

    1. Jason Noel says :Reply
      July 6, 2017 at 10:01 am

      I’m glad that this helped. It drove me crazy as well.

What are your thoughts? Write a comment below! Cancel reply

Your email address will not be published. Required fields are marked *

Infule Jason Noel

About Founder Jason Noel

Jason Noel has been published in Moz, Search Engine Journal, RV Pro among others. Jason developed infule’s “Digital Marketing Roadmap“, which helps business owners succeed in their online marketing.

Must Read Pages

  • Online Marketing Strategies
  • Website Design
  • SEO Services
  • E-Commerce
  • WordPress Web Design
  • Joomla Web Design

Get Free Access Today

Get exclusive access to our “Digital Marketing Roadmap” system sent directly to your email.

  • Website Design
  • SEO Services
  • PPC Marketing
  • E-Commerce
  • Website Hosting
  • WordPress Web Design
  • Joomla Web Design
  • Online Marketing Strategies

Digital Marketing Roadmap Tips

Increase your digital marketing using tips from our monthly newsletter.

We never spam!

Get In Touch

infule LLC
2138 Copper Creek Drive Unit C
Fort Collins, CO 80528

Phone: (970) 639-0777
Email us here

  • GET SOCIAL
infule

© 2019 Infule. All rights reserved.

TOP