Need Shipping Method on PayPal checkout page.

  • Posts: 332
  • Thank you received: 6
9 years 2 months ago #213372

-- url of the page with the problem -- : fearlessrider.com
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.4.33
-- Browser(s) name and version -- : Multiple
-- Error-message(debug-mod must be tuned on) -- : No error message.

I read this post, http://hikashop.com/forum/payment-methods/873062-shipping-description-as-line-item-in-paypal.html#179914 , about the issue with a plain 'Shipping' listed on the PayPal checkout. I have a similar issue with a client that needs to know not only that the shipping is 'USPS' but if it is 'Priority Mail' or 'First Class Mail' so they can have the proper shipping label generated.

Can this be done and, if so, how?

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
9 years 2 months ago #213375

Hi,

You can use the same kind of code than in the order display.

echo JText::_('HIKASHOP_SHIPPING_METHOD') . ' : ';
if(is_string($this->order->order_shipping_method)) {
	if(strpos($this->order->order_shipping_id, '-') !== false)
		echo $this->shippingClass->getShippingName($this->order->order_shipping_method, $this->order->order_shipping_id);
	else
		echo $this->shipping->getName($this->order->order_shipping_method, $this->order->order_shipping_id);
} else
	echo implode(', ', $this->order->order_shipping_method);

Where "shipping" and "shippingClass" are coming from
$pluginsShipping = hikashop_get('type.plugins');
$pluginsShipping->type='shipping';
$this->assignRef('shipping',$pluginsShipping);

$shippingClass = hikashop_get('class.shipping');
$this->assignRef('shippingClass', $shippingClass);

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 332
  • Thank you received: 6
9 years 2 months ago #213402

Jerome,

I'm not a neophyte as I 'use' to be in application development back in the 70's - 90's, which is basically the dinosaur era, but if you could let me know the file name to be changed as well as a before and after view of the code you are instructing me to change, that would be terrific.

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 2 months ago #213403

Hi,

The file to change is plugins/hikashoppayment/paypal/paypal.php
The change explained in that other thread ( hikashop.com/forum/payment-methods/87306...n-paypal.html#180163 ) will use the shipping method name instead of just "shipping".
For the service name, I guess you could change the line:

$vars['item_name_' . $i] = $order->order_shipping_method;
to:
$vars['item_name_' . $i] = $order->order_shipping_method.' '.$order->order_shipping_id;
in the code change of the other thread.

Please note that this is outside user support.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum