Payment logos and Shipper Information

Re: Payment logos and Shipper Information

Postby alan.underwood@.....uk » Tue Apr 03, 2012 11:52 am

Hi Stan - I've emailed you again asking for your skype id - I'm under alot of pressure to get the issues sorted so would appreciate a response asap.

Thank you
alan.underwood@.....uk
 
Posts: 10
Joined: Fri Mar 23, 2012 3:00 pm

Re: Payment logos and Shipper Information

Postby alan.underwood@.....uk » Tue Apr 03, 2012 11:58 am

The extension I use for google checkout is ose google checkout http://extensions.joomla.org/extensions ... stems/8045

The payment extra info was modified by the developer to convert to british pounds before sending the cart to google checkout (as they don't accept euros)

"<?php
/* This extra information will redirect your users to this link with the information :
index.php?page=account.order_details&order_id=".$db->f("order_id")."&option=com_virtuemart&Itemid=".$Itemid
with the messsage of:
Please review the order and click the google checkout button to finish the payments.
*/
$q2= "SELECT * FROM #__vm_user_info WHERE user_info_id='".mysql_real_escape_string(trim($db->f("user_info_id")))."'";
$dbst= new ps_DB;
$dbst->setQuery($q2);
$dbst->query();
$dbst->next_record();
if (GOOGLE_SANDBOX==false)
{
$url= "https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/".GOOGLE_MERCHANT_ID;
}
else
{
$url="https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/".GOOGLE_MERCHANT_ID;
}
$tax_total= $db->f("order_tax") + $db->f("order_shipping_tax");
$discount_total= $db->f("coupon_discount") + $db->f("order_discount");
$order_total= $db->f("order_subtotal") + $tax_total - $discount_total;

// Modified by Helix
// reset currency

$_SESSION['vendor_currency'] = 'GBP';
$exrate = '0.84';
$tax_total = $tax_total*$exrate;
$discount_total = $discount_total*$exrate;
$order_total = $order_total*$exrate;


$q3= "SELECT country_2_code FROM #__vm_country WHERE country_3_code='".mysql_real_escape_string(trim($dbst->f("country")))."'";
$dbst2= new ps_DB;
$dbst2->setQuery($q3);
$dbst2->query();
$dbst2->next_record();
if($dbst2->f("country_2_code") == "GB")
$country_code= "UK";
else
$country_code= $dbst2->f("country_2_code");
$post_variables= array();
$i= 1;
$jdb= new ps_DB;
$query= "SELECT * FROM #__vm_order_item WHERE order_id=".(int)$db->f("order_id");
$jdb->query($query);
while($jdb->next_record()) {
$post_variables['item_name_'.$i]= $jdb->f("order_item_name");
$post_variables['item_description_'.$i]= $jdb->f("order_item_name");
$post_variables['item_merchant_id_'.$i]= $db->f("order_number");
$post_variables['item_quantity_'.$i]= $jdb->f("product_quantity");
$post_variables['item_price_'.$i]= $jdb->f("product_item_price")*$exrate;
$post_variables['item_currency_'.$i]= $_SESSION['vendor_currency'];
$jdb2= & JFactory :: getDBO();
$query= "SELECT `product_parent_id` FROM `#__vm_product` WHERE product_id='".$jdb->f("product_id")."'";
$jdb2->setQuery($query);
$parent_id= $jdb2->loadResult();
if($parent_id > 0) {
$product_id= $parent_id;
} else {
$product_id= $jdb->f("product_id");
}
$query= "SELECT `tax_rate` FROM `#__vm_tax_rate` as a LEFT JOIN `#__vm_product` as b ON a.tax_rate_id= b.product_tax_id WHERE b.product_id={$product_id}";
$jdb2->setQuery($query);
$my_taxrate= $jdb2->loadResult();
if(empty($my_taxrate)) {
$query= "SELECT `tax_rate` FROM `#__vm_tax_rate` WHERE tax_country='{$_SESSION['auth']['country']}'";
$jdb2->setQuery($query);
$my_taxrate= $jdb2->loadResult();
}
if(empty($my_taxrate)) {
$my_taxrate= 0;
}
$post_variables['shopping-cart.items.item-'.$i.'.tax-table-selector']= "item-".$i;
$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.name']= "item-".$i;
$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.standalone']= "true";
$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.alternate-tax-rules.alternate-tax-rule-1.rate']= $my_taxrate;
$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.alternate-tax-rules.alternate-tax-rule-1.tax-areas.world-area-1']= "";
$i++;
}
//Shipping
$shippingcosts=$db->f("order_shipping")*$exrate;

if (!empty($shippingcosts) && $shippingcosts!='0.00')
{
$shipping_tax_rate = $db->f("order_shipping_tax")/ $db->f("order_shipping");
$post_variables['item_name_'.$i]= "Shipping and handling";
$post_variables['item_description_'.$i]= "Shipping and handling costs: ".$_SESSION['vendor_currency']." ".$db->f("order_shipping");
$post_variables['item_merchant_id_'.$i]= $db->f("order_id");
$post_variables['item_quantity_'.$i]= 1;

$post_variables['item_price_'.$i]= sprintf("%.2f", $db->f("order_shipping")*$exrate);
$post_variables['item_currency_'.$i]= $_SESSION['vendor_currency'];
$post_variables['shopping-cart.items.item-'.$i.'.tax-table-selector']= "item-".$i;

$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.name']= "item-".$i;
$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.standalone']= "true";
$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.alternate-tax-rules.alternate-tax-rule-1.rate']= $shipping_tax_rate;
$post_variables['checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-'.$i.'.alternate-tax-rules.alternate-tax-rule-1.tax-areas.world-area-1']= "";
$i++;
}
if(!empty($discount_total)) {
$discount_total=(-1) * $discount_total;
$post_variables['item_name_'.$i]= "Coupon Amount";
$post_variables['item_description_'.$i]= "Coupon Discount: ".$_SESSION['vendor_currency']." ".$discount_total;
$post_variables['item_merchant_id_'.$i]= $db->f("order_id");
$post_variables['item_quantity_'.$i]= 1;
$post_variables['item_price_'.$i]= $discount_total;
$post_variables['item_currency_'.$i]= $_SESSION['vendor_currency'];
$i++;
}



$post_variables['continue_url']= SECUREURL."index.php?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id");

if($page == "checkout.thankyou") {
$Itemid= JRequest :: getVar("Itemid");
vmRedirect("index.php?page=account.order_details&order_id=".$db->f("order_id")."&option=com_virtuemart&Itemid=".$Itemid);
echo '<form action="'.$url.'" method="post" target="_blank" id="google" name="google"><input type="hidden" name="googleCheckout" value="octl53wDFSC-rSEy-S6gRa-jWtb" />';
echo '<input type="image" name="Google Checkout" alt="Fast checkout through Google"
src="images/checkout.gif?merchant_id='.GOOGLE_MERCHANT_ID.'&w=180&h=46&style=white&variant=text&loc=en_US"
height="46" width="180"/>';
foreach($post_variables as $name => $value) {
echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'" />';
}
echo '</form>';
} else {
echo '
<font color="red">Please review the order and click the google checkout button to finish the payments.</font><br/>
<form action="'.$url.'" method="post" target="_blank"><input type="hidden" name="googleCheckout" value="octl53wDFSC-rSEy-S6gRa-jWtb" />';
echo '<input type="image" name="Google Checkout" alt="Fast checkout through Google"
src="images/checkout.gif?merchant_id='.GOOGLE_MERCHANT_ID.'&w=180&h=46&style=white&variant=text&loc=en_US"
height="46" width="180"/>';
foreach($post_variables as $name => $value) {
echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'" />';
}
echo '</form>';
}
?>"
alan.underwood@.....uk
 
Posts: 10
Joined: Fri Mar 23, 2012 3:00 pm

Re: Payment logos and Shipper Information

Postby alan.underwood@.....uk » Wed Apr 04, 2012 2:49 pm

Hi Stan - Are you able to sort the issue for me?
alan.underwood@.....uk
 
Posts: 10
Joined: Fri Mar 23, 2012 3:00 pm

Re: Payment logos and Shipper Information

Postby admin » Thu Apr 05, 2012 4:12 pm

Just to close this thread, it was fixed over skype support.
Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Previous

Return to One Page Checkout for Virtuemart 1.1.x

cron