Products     Magento Extension     PCI-Shopping-Carts     Templates       CRELoaded     WordPress Modules     osCommerce Modules       osCommerce Addons       osCommerce Features       osCommerce Management       Payment Modules     CRELoaded Modules       CRE Loaded Addons       CRE Loaded Features       CRE Loaded Management       Payment Modules       CRELoaded Services
Free Stuff
Customization
Templates
Compare Products
You have no items to compare.
Affiliate Info
Affiliate Program FAQ
Affiliate Log In
Recent Orders
Hot Keywords: Order Notification, Order Search, Coupon, Flash Board, Compare, Floating Message, Tracking, Moneris, RSS, Visitor Filter

  Product Attributes Clone tool

The following osCommerce contribution is a free Opensource code originated from official osCommerce website and provided for your reference only, you may download the original contribution file(s) and install it on your own; or you may request a Paid Installation Service from Agents Of Power; Agents Of Power does the "AS IS" installation on your website, we do not guarantee it will work properly on your website. Extra Paid service is available for repairing the problem from the original contribution or from your website.
bug.

The following error occurs:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '')' at line 1

INSERT INTO products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefixt) VALUES (184, 10, 29, 0.0000, ')

[TEP STOP]



to solve change:

price_prefixt to price_prefix
and
.")"); to ."')");
I was frustrated that it seems no tool existed to clone all attributes from one product to multiple others, so I came up with the attached solution

FIND at line 27:
************
case 'clone_attributes':
$clone_product_id_from = $HTTP_POST_VARS['clone_products_id_from'];
$clone_product_id_to = $HTTP_POST_VARS['clone_products_id_to'];
tep_db_query("delete from ".TABLE_PRODUCTS_ATTRIBUTES." WHERE products_id='".$clone_product_id_to."'");
$attributes = tep_db_query("select products_id, options_id, options_values_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES ." where products_id='".$clone_product_id_from."'");

while($attributes_values = tep_db_fetch_array($attributes)) {

tep_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " ( products_id, options_id, options_values_id, options_values_price, price_prefix ) VALUES (".$clone_product_id_to.", ".$attributes_values['options_id'].", ".$attributes_values['options_values_id'].", ".$attributes_values['options_values_price'].", '".$attributes_values['price_prefix']."')");

}
break;
************


REPLACE WITH:
************
// BOF Multiple Product Attributes Clone
case 'clone_attributes':
$multi_clone_products_id_to=$HTTP_POST_VARS['clone_products_id_to'];
for ($i=0;$i<sizeof($multi_clone_products_id_to);$i++) {
$clone_product_id_from = $HTTP_POST_VARS['clone_products_id_from'];
$clone_product_id_to = $multi_clone_products_id_to[$i];
tep_db_query("delete from ".TABLE_PRODUCTS_ATTRIBUTES." WHERE products_id='".$clone_product_id_to."'");
$attributes = tep_db_query("select products_id, options_id, options_values_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES ." where products_id='".$clone_product_id_from."'");
while($attributes_values = tep_db_fetch_array($attributes)) {
tep_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " ( products_id, options_id, options_values_id, options_values_price, price_prefixt) VALUES (".$clone_product_id_to.", ".$attributes_values['options_id'].", ".$attributes_values['options_values_id'].", ".$attributes_values['options_values_price'].", '".$attributes_values['price_prefix'].")");
}
}
break;
// EOF Multiple Product Attributes Clone
************




FIND at line 781:
************
<select name="clone_products_id_to">
************



REPLACE WITH:
************
<select name="clone_products_id_to[]" multiple size="20">
************


Hope that helps someone...
   Posted on: 09/10/2008     See contribution details Request Installation with Paid service