Shipping description as line item in Paypal

  • Posts: 25
  • Thank you received: 1
10 years 1 week ago #179914

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.15
-- Browser(s) name and version -- : Chrome

I'm not sure if this is a shipping plugin question or payment plugin question but I'll post it here.

Is there a way to get the shipping method type as a line item with the Paypal plugin?
I use the USPS shipping plugin and have three types of shipping available (priority, express and first class). When the payment is made the shipping total shows up as a line item in Paypal but there is no description as to which method is chosen. So when the email from Paypal comes across it displays as this:

Shipping details:
You haven’t added any shipping details.
-----------------------------------
Purchase Details
-----------------------------------
Description:BMA250, Item#:DSSC-0117
Unit price:$9.00 USD
Qty:1
Amount:$9.00 USD
Description:Shipping, Item#:
Unit price:$5.75 USD
Qty:1
Amount:$5.75 USD

I use a third party shipping software (Shipstation) to import the orders from Paypal and I can map names and setup automatic shipping methods. Unfortunately there is no description other than the word shipping so I will have to open each invoice separately to determine the shipping method. Any ideas?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 week ago #180000

Hello,
That's a payment plugin question, to do that you'll have to directly edit the code of the "paypal.php" file of the PayPal plugin, editing these lines should do the job :

if(!empty($order->order_shipping_price) && bccomp($order->order_shipping_price, 0, 5)) {
	$vars['item_name_' . $i] = JText::_('HIKASHOP_SHIPPING');
	$vars['amount_' . $i] = round($order->order_shipping_price - @$order->order_shipping_tax, (int)$this->currency->currency_locale['int_frac_digits']);
	$tax += round($order->order_shipping_tax, (int)$this->currency->currency_locale['int_frac_digits']);
	$vars['quantity_' . $i] = 1;
	$i++;
}

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

  • Posts: 25
  • Thank you received: 1
10 years 1 week ago #180095

Thanks Mohamed but that code appears to be the same code that is already in the file?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 week ago #180163

Hello,
You'll just have to change that line :

$vars['item_name_' . $i] = JText::_('HIKASHOP_SHIPPING');
By these lines :
if(!empty($order->order_shipping_method))
	$vars['item_name_' . $i] = $order->order_shipping_method;
else
	$vars['item_name_' . $i] = JText::_('HIKASHOP_SHIPPING');

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

  • Posts: 25
  • Thank you received: 1
10 years 1 week ago #180240

Thanks Mohamed but is there any way to get it to send the type of shipping for USPS. Currently this code sends the description, usps, but it doesn't specify which method of USPS (ie First Class, Priority, Express, etc...). Would it be possible to pass that parameter as well?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 week ago #180287

Hello,

Would it be possible to pass that parameter as well?

That will require more code customization, which won't be that easy to do.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum