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

TOPIC: Hide "Select Shipment" button until shipping address is provided.

Hide "Select Shipment" button until shipping address is provided. 11 years 2 months ago #2312

Hi,

One of our customer has risen this issue:
In the checkout, with an unregistered customer, we need to force as first step to put his shipping details, because if not he has difficulties to select shipping service, and tends to leave cart without complete. Infact as a default option it tends to give the more expensive international, because he doesn't know which nation. Do you have an idea about how to fix this confusion?

Yes, we are aware of the "shipping cost" confusion in the Virtuemart.
Unfortunately this is how Virtuemart was developed at the first place. Buyers should provide an address before clicking the "select shipment" button. But %30-%40 of the potential buyers click directly to "shipping" method button to see the shipping costs without telling to system where they are located and where they want the goods to be shipped. This doesn't make any sense, but some people do that. So it would be better to hide the "select shipment" button until the user provide a shipping address (country and state) OR tell them something like "Provide shipping address first to see the shipping cost"


We didn't include this patch to our VM Template, because it was the way the Virtuemart works and some people still love the way it works (mostly they don't offer different shipping rates based on the destination)

But here is patch to stop this confusion:

Open this PHP file:

ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/cart/default_pricelist.php


In the 510th line, include these lines:
<?php 
@$checkIfEmpty == "none";
foreach($this->cart->BTaddress['fields'] as $item){	
@$checkIfEmpty .= $this->escape($item['value']);
}
if ($checkIfEmpty == "") {	?>
<td colspan="4" style="text-align:right;">Please provide shipping address to estimate the shipping cost.</td>
<? } else { ?>

(you can rewrite/translate the "Please provide shipping address to estimate the shipping cost." to whatever you want in above lines. You can style it with <span>, <div> TAGs or include an image next to it. It is an ordinary HTML line.

Now Look at the 543th line (it will be 543th after you added the above lines to 510th)

and add this
<?php } ?>

to close the If...END condition.

That's it.


To make sure you are copy-pasting them to correct locations, See the screenshots below:

Attachment Pasted_Image_2_6_13_7_40_AM-2.gif not found



Attachment Pasted_Image_2_6_13_7_41_AM-2.gif not found




Then the result in the shopping cart will be:

Attachment Pasted_Image_2_6_13_7_46_AM-2.gif not found




Attachment Pasted_Image_2_6_13_7_48_AM-2.gif not found




Forum Support.
Regards.
Last Edit: 11 years 2 months ago by Support.
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 10 months ago #4954

Sounds great, but the solution doesn't work for me. Your explanation includes 2 versions of the php code at line 543:
<?php } ?> OR <? } ?>
I tried both but neither changes the checkout page.

I'm using:
J 2.5.11
VM 2.0.20b
PureMart 3.6
Last Edit: 10 years 10 months ago by Richard Sparks. Reason: add more details
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 10 months ago #4962

<?php } ?> OR <? } ?> are equivalent - one is shorthand - but for full compatibility use

<?php } ?>

as to no change - adding this code must change something - even if it is an error..

where can I see your site?

Cheers
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 10 months ago #4971

Yes, my website is on a temporary URL -- 70.84.200.20/~tempsite/

I added the recommended code again but there still no difference (see screenshot). I think a different issue on the checkout page might also be affecting this. On the checkout page, if the customer isn't logged in or provided their address, the Bill To & Shipment Information section should be hidden (it's hidden in your demo), but it is displaying with "0" by each address field.

I checked it in Firefox 21, Safari 6.0.4 and Chrome 26.0.1410.65 on Apple OS X to see if it was a browser issue, but they are all the same.

Thanks for helping with this!
Richard
Attachments:
Last Edit: 10 years 10 months ago by Richard Sparks. Reason: add more details
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 10 months ago #4992

I assume the code won't make any difference because it is checking to see if the address has been filled in and it is - with zeros!!!!
and here's why you have zeros

forum.virtuemart.net/index.php?topic=111531.0
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 10 months ago #5000

Thank you!! That fixed my problems! The 0's are gone now, so the Bill To & Shipment Information section and the "Select Shipment Method" button are both hidden like they should be.

Perfect :-)
Richard
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 10 months ago #5010

excellent - very amazed VM still haven't fixed this bug!!!!!
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 3 months ago #7954

me too ! awesome hack thanks.
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 3 months ago #7960

Hi Richard,

This modification has become "permanent" in the PureMart with the latest versions (by default). You can enable/disable this feature through PureMart plugin. But for those who have the old versions or haven't purchased any template from us, are welcome to use this trick ;)

Regards.
Support
The administrator has disabled public write access.

Hide "Select Shipment" button until shipping address is provided. 10 years 3 months ago #7964

Having done the "trick" in 3.8, i upgraded to 3.9 and the shipment option is back,as i expected, i tried YES and NO in the new updated plugin but the option is still there ?
I can do the "trick" again but thought i would let you know.
The administrator has disabled public write access.
Time to create page: 0.282 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