| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
How to bulk change the price of ALL product | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How to bulk change the price of ALL product
anybody has any idea how to do this, please share.
Let's say the price of all my products increased $5. How do we add $5 to the price of all products? Of course we don't want to go to 1000's of products and edit one at a time. I think we have to go to the php codes and modify the price variable, but not where what file. Any inputs will be appreciated very much. Thank you.
__________________
en |
|||||||
#2
|
|||||||||
|
|||||||||
Re: How to bulk change the price of ALL product
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: How to bulk change the price of ALL product
You can do this by:
- Export your products - Import into Excel - Delete all columns except for productcode and price - Rename price column to old_price - Add a new column new_price with formula to adjust old price as desired. - Copy values of of new_price to another new column called price. - Delete the old_price and new_price column leaving only productcode and price - Export to CSV - Import to store
__________________
Richard Williams Rogue Wave Limited Initial Inventory Imports Daily Inventory Updates Daily Inventory Reports Drop Ship Support Order Export to Shipper/Supplier Shopping Feeds That Work Programming for X-Cart richard@roguewavelimited.com http://www.roguewavelimited.com |
|||||||||
|
#4
|
|||||||||
|
|||||||||
Re: How to bulk change the price of ALL product
this can be achieved with one line in the SQL i believe
__________________
Richard Ultimate 5.4 testing |
|||||||||
|
#5
|
|||||||||
|
|||||||||
Re: How to bulk change the price of ALL product
Quote:
No you cannot. You can change the price in pricing table with simply sql statement but XC uses quick tables to cache and for faster access to pricing, also there is different pricing depending variants, options, membership, etc. so the one line sql statement may not be enough
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#6
|
|||||||
|
|||||||
Re: How to bulk change the price of ALL product
Or you could just do this. https://www.cflsystems.com/products-bulk-prices-for-x-cart-classic.html
__________________
v4.7.12 v5.4.x (In Dev) |
|||||||
|
#7
|
|||||||
|
|||||||
Re: How to bulk change the price of ALL product
Quote:
Is the mod 4.7.11 ready ? Just ran the install - sql patches success, files uploaded ok, and file changes ok - cleared cache. Created a dummy directory and product. Applied bulk discount - increased by $1 and got this in the admin dashboard :- * @copyright Copyright (c) 2015 CFL Systems, Inc. All rights reserved. * @license CFL Systems Software License Agreement - https://www.cflsystems.com/software-license-agreement.html * @link https://www.cflsystems.com/products-bulk-prices-for-x-cart-classic.html */if ( !defined('XCART_START') ) { header("Location: ../../"); die("Access denied"); }function csi_get_productcode($pid) { global $sql_tbl; $tbl = 'variants'; $field = 'variantid'; $tmp = func_query_first_cell("SELECT variantid FROM $sql_tbl[pricing] WHERE priceid = '$pid'"); if ($tmp == 0) { $tmp = func_query_first_cell("SELECT productid FROM $sql_tbl[pricing] WHERE priceid = '$pid'"); $tbl = 'products'; $field = 'productid'; } $productcode = func_query_first_cell("SELECT productcode FROM $sql_tbl[$tbl] WHERE $field = '$tmp'"); return $productcode;}if ( $pricing_amount < 0 || !is_numeric($pricing_amount)) { $pricing_amount = 0;}$pricing_amount = floatval($pricing_amount);if ( $pricing_amount == 0 || (empty($cats) && empty($mans))) { $top_message['content'] = func_get_langvar_by_name('txt_bulk_pricing_error') ; $top_message['type'] = 'E'; $mode = ''; func_header_location($current_location . '/admin/products_bulk_pricing.php?err=1');}$join = array();$where = array();if (!empty($mans)) { $mans = implode(',', $mans); $where[] = "$sql_tbl[products].manufacturerid IN ($mans)";}if (!empty($cats)) { $cats = implode(',', $cats); if ($only_main_cat == 'Y') { $where[] = "$sql_tbl[products_categories].categoryid IN ($cats) AND $sql_tbl[products_categories].main = 'Y'"; } else { $where[] = "$sql_tbl[products_categories].categoryid IN ($cats)"; } $join[] = "LEFT JOIN $sql_tbl[products_categories] ON $sql_tbl[products].productid = $sql_tbl[products_categories].productid";}$join = implode(' ', $join);$where = empty($where) ? '' : 'WHERE ' . implode(' AND ', $where);$productids = func_query_column("SELECT $sql_tbl[products].productid FROM $sql_tbl[products] $join $where");unset($where);if (!empty($productids)) { $skipped_products = array(); $where = array(); $where[] = "productid IN (" . implode(',', $productids) . ")"; if (!empty($pricing_wholesale)) { $where[] = 'quantity = 1'; } if (!empty($memberships)) { $memberships = implode(',', $memberships); $where[] = "membershipid IN ($memberships)"; } $where = empty($where) ? '' : 'WHERE ' . implode(' AND ', $where); $priceids = func_query("SELECT priceid, price FROM $sql_tbl[pricing] $where"); if (!empty($priceids)) { foreach ($priceids as $k=>$v) { if ($pricing_type == 'percent') { $diff = $v['price'] * $pricing_amount / 100; } elseif ($pricing_type == 'fixed') { $diff = $pricing_amount; } if ($pricing_direction == 'up') { $newprice = $v['price'] + $diff; } elseif ($pricing_direction == 'down') { $newprice = $v['price'] - $diff; } if (!empty($pricing_round)) { $newprice = round($newprice); } if ($newprice <= 0) { $skipped_products[] = csi_get_productcode($v['priceid']); continue; } db_query("UPDATE $sql_tbl[pricing] SET price = $newprice WHERE priceid = " . $v['priceid']); } foreach ($productids as $p) { func_build_quick_prices($p); func_build_quick_flags($p); } $top_message['content'] = func_get_langvar_by_name('txt_bulk_pricing_updated '); $top_message['type'] = 'I'; $smarty->assign('skipped_products', $skipped_products); } else { $top_message['content'] = func_get_langvar_by_name('txt_bulk_pricing_no_prod ucts'); $top_message['type'] = 'I'; } } else { $top_message['content'] = func_get_langvar_by_name('txt_bulk_pricing_no_prod ucts'); $top_message['type'] = 'I';}func_header_location($current_location . '/admin/products_bulk_pricing.php');
__________________
x-cart Gold Plus 4.7.12 CDSEO Pro latest ver ReDux template xcartmods.co.uk - it's great php 7.x |
|||||||
#8
|
|||||||
|
|||||||
Re: How to bulk change the price of ALL product
run mysql via phpmyadmin
__________________
x-cart gold 4.7.12, www.eyewearuk.com - Eyewear Uk http://www.eyewearcanada.com - Eyewear Canada http://www.australiaglasses.com - Australia Glasses Glasses - How to Buy Eyeglasses Online www.cheapglasses123.com Glassess USA |
|||||||
#9
|
|||||||||
|
|||||||||
Re: How to bulk change the price of ALL product
Quote:
This is spitting out the content of the php file instead of running it. Check what you have uploaded and that the actual files are php files. Are you running this on a working cart or newly installed test cart? If new make sure the server knows it has to process php files as php files and not just dump their content in the browser.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#10
|
|||||||
|
|||||||
Re: How to bulk change the price of ALL product
Yep running on a live cart - 4.7.11
Re checked files and uploaded again, uninstalled and re installed .sql patch via phpmyadmin - screen shot attached and cleared cache - still get the issue in the xcart dashboard - and when I load up the module - make the change - the changes arent made etc. Triple checked this now and all is as according to the instructions , I cant see that Ive missed anything
__________________
x-cart Gold Plus 4.7.12 CDSEO Pro latest ver ReDux template xcartmods.co.uk - it's great php 7.x |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|