Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Not working for me, may be anyone can help me with this contribution

 

http://www.oscommerce.com/community/contri...ry,3/search,XML

 

or know how to?

 

Need a simple script to update product quantity and price based on product_id

 

Here is the part of original code

 

require('includes/application_top.php');

 

if ($_POST['action']=='import') {

if (is_uploaded_file($_FILES['xml_file']['tmp_name'])) {

$xml = new XML($_FILES['xml_file']['tmp_name']);

$products = $xml->evaluate("//product");

$count=0;

$count_upd=0;

$count_add=0;

 

phpXML error: File /tmp/phpFiVZJY could not be found or read.

 

Change part of code

 

if ($_POST['action']=='import') {

if (is_uploaded_file($HTTP_POST_FILES['xml_file']['tmp_name'])) {

$xml = new XML($HTTP_GET_FILES['xml_file']['tmp_name']);

$products = $xml->evaluate("//product");

$count=0;

$count_upd=0;

$count_add=0;

 

and result will be

 

Success Updated 0

Success Not changed 0

Success Added 0

 

File upload to remote server also not working :(

 

May be problem consist in PHP version used by provider?

  • 3 months later...
Posted (edited)

mayby you get this

and result will be

 

Success Updated 0

Success Not changed 0

Success Added 0

because products update's only if price changed?

 

try this:

 

replace line 31

if ($row['products_price']!=$products_price) {

with

// BOF lets update by price or quantity changed (next commented row was original)
//		if ($row['products_price']!=$products_price)  {
  if (($row['products_price']!=$products_price) || ($row['products_quantity']!=$products_quantity))  {
// EOF lets update by price or quantity changed

Edited by dAbserver

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...