Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

USPS Click N Ship Link in Vendor Email Rate Topic   - - - - -

 

Posted 17 January 2012 - 02:32 PM #1

Goal: For vendor to receive email after sale with a link which they can click which will auto-fill USPS Click n Ship with Origin & Destination information. Luckily vendor emails can be simply enabled in the Admin Panel, the code for the USPS link needs to be written and attached to email. This will drastically speed up the online postage process for the vendor.

What's currently complete: Everything besides total weight calculation of all products on invoice.

Problem: The code is nearly complete, however I am wondering if anyone knows where I can quickly access the total weight of an invoice in the CS Cart Database. I'm not sure if a total weight is stored anywhere, or if logic needs to be written to add weights of all products in Invoice.

I am working on this problem this evening, please reply if you have thoughts or suggestions.

Thanks

 
  • Alt-team
  • CS-Cart Developer
  • Authorized Reseller
  • Join Date: 18-Jan 11
  • 2638 posts

Posted 18 January 2012 - 10:15 AM #2

Hello, husseinsharif!

Unfortunately, there is no total weight information in CS-Cart database. But you can find weight info in {$order_info.shipping...} You will need to sum up product weights if more than one product is to be shipped.

Best regards, Alt-team

ADD-ONS  Web development service  | CS-Cart dedicated developers

Buy MULTIVENDOR - USD 1250 (14% off)   Buy CS-CART LICENCE - USD 345 (13% off)

 Email - manager@alt-team.com | Skype - Altteam    


 

Posted 18 January 2012 - 11:45 AM #3

Great - thanks for this info. Perhaps I'm new, but I'm not understanding $order_info thoroughly

Is $order_info.shipping an array which contains info regarding a specific order for shipping?

Any idea where $order_info is assembled so I can take a look at the code and understand how it's all put together?

I am working within invoice.tpl by the way.

Your help is greatly appreciated

Hussein

 
  • Alt-team
  • CS-Cart Developer
  • Authorized Reseller
  • Join Date: 18-Jan 11
  • 2638 posts

Posted 19 January 2012 - 12:29 PM #4

Yes, you are right, $order_info.shipping is an array which contains info regarding a specific order for shipping. $order_info.shipping variable is in invoice.tpl file (skins/basic/mail/orders/invoice.tpl).
Try to find this piece of code
{if $tracking_number_exists}
<tr valign="top">
<td style="font-size: 12px; font-family: verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.tracking_number}:</td>
<td style="font-size: 12px; font-family: Arial;">
{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{if $shipping.tracking_number}{$shipping.tracking_number}{if !$smarty.foreach.f_shipp.last},{/if}{/if}
{/foreach}
You need to do some programming to add total weight calculation on invoice.

Best regards, Alt-team

ADD-ONS  Web development service  | CS-Cart dedicated developers

Buy MULTIVENDOR - USD 1250 (14% off)   Buy CS-CART LICENCE - USD 345 (13% off)

 Email - manager@alt-team.com | Skype - Altteam    


 

Posted 19 January 2012 - 09:58 PM #5

Thank you Alt-Team for your informative responses. Your information + Smarty Template debugging helped me solve the problem.

I've found and inserted the total product weight of the invoice into the USPS link....

at this point, the link in the order completion email fully auto-populates the USPS Click N Ship form with the information already provided to CS Cart from the customer.

If anyone would like this code - please let me know!