Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Amazon Seller Central invoice PDF batch print


Guest

Recommended Posts

Hi Everyone

 

I'm developping a module for Amazon Seller Central that will reuse some functions of the existing PDF batch print module.

The module will import txt files from order notifications, display the orders and print a PDF contining a batch of a range of orders.

 

I'm using a clone of the order.php class, but only the FIRST item of an order containing multiple items is retrieved.

Looks like my products array is not fetched correctly, and I don't understand why.

 

Here is the query in the order.php class:

 

 $orders_products_query = tep_db_query("SELECT oi.order_id, oi.order_item_id, oi.product_name, oi.sku, oi.item_price, oi.item_tax, oi.shipping_price, oi.shipping_tax, oi.quantity_purchased, oi.item_promotion_id, oi.item_promotion_discount, oi.ship_promotion_id, oi.ship_promotion_discount FROM amazon_items oi WHERE oi.order_id = '" . $order['order_id'] ."'"); 
  $num_rows = mysql_num_rows($orders_products_query);

 while ($orders_products = mysql_fetch_array($orders_products_query, MYSQL_ASSOC)) {
	$this->products[$index] = array(
'order_id' => $orders_products['order_id'],
'order_item_id' => $orders_products['order_item_id'],
'quantity_purchased' => $orders_products['quantity_purchased'],
'product_name' => $orders_products['product_name'],
'sku' => $orders_products['sku'],
'shipping_price' => $orders_products['shipping_tax'],
'shipping_tax' => $orders_products['shipping_price'],
'item_promotion_id' => $orders_products['item_promotion_id'],
'item_promotion_discount' => $orders_products['item_promotion_discount'],
'ship_promotion_id' => $orders_products['ship_promotion_id'],
'ship_promotion_discount' => $orders_products['ship_promotion_discount'],
'item_price' => $orders_products['item_price'],
'item_tax' => $orders_products['item_tax']);
}

 

and in my packing_slip and invoice.php, the products are is rendered with a

 

for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

...

...}

 

 

I echoed the variable $n, that gives the size of the array, and its value is always 1, no matter how many products are in the order...

 

I echoed the query in the order class, and the correct number of products are returned.

 

Any help would be appreciated.

Link to comment
Share on other sites

  • 3 weeks later...
Hi Everyone

 

I'm developping a module for Amazon Seller Central that will reuse some functions of the existing PDF batch print module.

The module will import txt files from order notifications, display the orders and print a PDF contining a batch of a range of orders.

 

I'm using a clone of the order.php class, but only the FIRST item of an order containing multiple items is retrieved.

Looks like my products array is not fetched correctly, and I don't understand why.

 

Here is the query in the order.php class:

 

 $orders_products_query = tep_db_query("SELECT oi.order_id, oi.order_item_id, oi.product_name, oi.sku, oi.item_price, oi.item_tax, oi.shipping_price, oi.shipping_tax, oi.quantity_purchased, oi.item_promotion_id, oi.item_promotion_discount, oi.ship_promotion_id, oi.ship_promotion_discount FROM amazon_items oi WHERE oi.order_id = '" . $order['order_id'] ."'"); 
  $num_rows = mysql_num_rows($orders_products_query);

 while ($orders_products = mysql_fetch_array($orders_products_query, MYSQL_ASSOC)) {
	$this->products[$index] = array(
'order_id' => $orders_products['order_id'],
'order_item_id' => $orders_products['order_item_id'],
'quantity_purchased' => $orders_products['quantity_purchased'],
'product_name' => $orders_products['product_name'],
'sku' => $orders_products['sku'],
'shipping_price' => $orders_products['shipping_tax'],
'shipping_tax' => $orders_products['shipping_price'],
'item_promotion_id' => $orders_products['item_promotion_id'],
'item_promotion_discount' => $orders_products['item_promotion_discount'],
'ship_promotion_id' => $orders_products['ship_promotion_id'],
'ship_promotion_discount' => $orders_products['ship_promotion_discount'],
'item_price' => $orders_products['item_price'],
'item_tax' => $orders_products['item_tax']);
}

 

and in my packing_slip and invoice.php, the products are is rendered with a

 

for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

...

...}

I echoed the variable $n, that gives the size of the array, and its value is always 1, no matter how many products are in the order...

 

I echoed the query in the order class, and the correct number of products are returned.

 

Any help would be appreciated.

 

 

Hello,

 

im still interested on this "modul/script". Did you share it ?

 

Tyv

Link to comment
Share on other sites

  • 4 weeks later...

Have you fully intergrated your store with amazon.com seller central. Please contact me if so, we may be able to work together.

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...