Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - PureMart (SKU# FLEX-00010)

TOPIC: Payment button does not display with free product

Payment button does not display with free product 11 years 2 months ago #3421

Hi,

In my shop customers can buy free products, this works fine. Selecting the right shipment of this product also goes fine but after that I have the problem that the payment button does not display. I go directly to 'confirm your order'. This probably has to do with the fact that the product price is 0,00 ? I defined a standard payment with 0,00 but that does not work. I can complete the order without payment but then the product remains in the shoppingcard.

How can I solve this problem?
The topic has been locked.

Payment button does not display with free product 11 years 2 months ago #3430

Hi,

What you are saying is against the structure of Virtuemart.
Normally, Virtuemart doesn't allow to sell free products. Once you leave the price field empty, the add to cart button turns to "call for price" button (of course you need to enable this option in the VM configuration).

This is how Virtuemart was designed and how the things developed. I can't guarantee you about the shopping cart (As i have never tried before) but i can give you the tip to show the "add to cart" button for those products that don't have price at all.

Open these 2 files:
1- Category Browse Page:

ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/category/default.php
(default.php, OR flexv2.php. There are 2 different category browse page layouts and you are using only one of them depends on what ever you chose from VM Configuration)

2- Product Details:

ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/productdetails/default.php
(default.php or flexv2.php. There are 2 different product details page layouts and you are using only one of them depends on what ever you chose from VM Configuration)

In those 2 PHP files, whereever you see this commands:

For category browse page PHP file:
(!empty($product->prices['salesPrice'])

For product details page PHP file:
(!empty($this->product->prices['salesPrice'])

delete it.

For instance, change this line:
if (!VmConfig::get('use_as_catalog', 0) and (!empty($product->prices['salesPrice']))) {?>
to
if (!VmConfig::get('use_as_catalog', 0)) {?>

This trick will eliminate the "price check" feature of virtuemart, and add to cart button start appearing even though the price is empty or 0.00. But again, i can't give you guarantee that everything runs smoothly through checkout, as virtuemart wasn't developed to sell free products. (also selling downloadable product not possible with VM2 unless the Downloadable plugin is installed to it)

Regards.
Forum Support.
The topic has been locked.

Payment button does not display with free product 11 years 1 month ago #3438

Hi, thanks for your reply!

I know what you are saying and you helped me earlier for displaying the add to cart button when a product is free. Your solution works perfectly! But... The same thing happens when I want to proceed the order. When i go to the shopping cart to the shipment and payment proces I am not able to pay. The choose a shipment button appears and I can choose a shipment, that works fine. But after that I have to get the ' choose payment' button and that one does not show up. It is problably, just like with the add to cart button, it does not show because the price is 0,00. Is it possible to force the payment proces to come up, even the price is 0,00 ?


Thanks !!
The topic has been locked.

Payment button does not display with free product 11 years 1 month ago #3440

I assume you tried a dummy standard (set to zero) payment method and set the VM admin to Enable Automatic Selected Payment?
You can try with setting maximum amounts etc in the payment method - but - you are only going to find a solution by experimentation.
If it isn't possible then you will need to hack the core -

VM isn't designed to let you check out with a value zero....

A quick look thru administrator/components/com_virtuemart/helpers/calculationh.php shows multiple checkout validations - mainly to prevent what your trying to do -
so you need to start looking there - the function calling the payment plugins is function calculatePaymentPrice() around line 1078

as you can see this file contains 1400 lines of code - so - good luck.. ;)
The topic has been locked.

Payment button does not display with free product 11 years 1 month ago #3467

Well, i tried about everything i think, does not work and I Am not going to try and hack the core if hacking is more then 10 words :-)

Thanks for your response!
The topic has been locked.

Payment button does not display with free product 11 years 1 month ago #3471

As we have said - VM doesn't do this - it has zero to do with our templates - they ONLY way you will acheive this is with core changes - wecan't do them for you as it has nothing to do with our templates -
we can advise on a 3rd party developer if that is what you are asking?

Cheers
Last Edit: 11 years 1 month ago by John.
The topic has been locked.

Payment button does not display with free product 11 years 1 month ago #3557

No, thank u John. I gave my client a different way for allowing customers to download a free product (Not within virtuemart)

Thanks for your help, topic closed!
The topic has been locked.

Payment button does not display with free product 11 years 1 month ago #3564

very good -- topic closed
The topic has been locked.
Time to create page: 0.438 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo