VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: logobis on May 01, 2013, 08:59:40 AM

Title: Shipment and Payment choice ONLY WHEN REGISTERED
Post by: logobis on May 01, 2013, 08:59:40 AM
Hi,

Using Joomla 2.5.11 and VM 2.0.20b.
I'm looking for a meaning to display shipment and payment choices only when customer is registered.
Actually, if not, on the cart panel, the customer show the text "select a shipment method" / "select a payment method" and when clicking is redirected on a page "sorry the selected method...."...that is not good !
So, I wish this 2 text should be displayed only when the customer is registered....
Does someone have this solution ?
(just a code in defaut_pricelist.php....if (customer registered) then ....).
Thank's
Title: Re: Shipment and Payment choice ONLY WHEN REGISTERED
Post by: K&K media production on May 01, 2013, 13:04:45 PM
if($this->cart->userdetails->virtuemart_user_id != 0) {

}


this should be work, but if you allow checkout as guest, it is better to look if in address country is not empty (if your shipment is country based)

if(!empty($this->cart->BT['virtuemart_country_id'])) {

}