Jump to content

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

Need Some Help Rate Topic   - - - - -

 
  • flasher
  • Senior Member
  • Members
  • Join Date: 26-Sep 05
  • 335 posts

Posted 21 August 2017 - 08:54 PM #1

I use 3.0 version which I have been for years but I need to change a word on all products to comply with manufactors request to for example " This word" needs to be "This Word" or I need to cap the second word but do not want to pull up each product I know I have done this before where I can pull up on one page and have them all change in title how do we do this


Version 1.3.5 & Latest Version

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20773 posts

Posted 22 August 2017 - 10:07 AM #2

I use 3.0 version which I have been for years but I need to change a word on all products to comply with manufactors request to for example " This word" needs to be "This Word" or I need to cap the second word but do not want to pull up each product I know I have done this before where I can pull up on one page and have them all change in title how do we do this

 

Export products, change data in bulk in .csv file and import it back


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11660 posts

Posted 22 August 2017 - 09:20 PM #3

It can also be done directly in the DB, but it's a bit more complicated than export/import for the non-developer type merchant.

 

Alternatively, you could add the following to your addons/my_changes/controlers/admin/my_changes.php

UNTESTED

if( !defined('AREA') ) die('Access denied');
 
switch($mode) {
  case 'uc_product_names':
    $affected = $cnt = 0;
    foreach(db_get_array("SELECT product_id, product FROM ?:product_descriptions") as $p_info) {
      db_query("UPDATE ?:product_descriptions SET product=?s WHERE product_id=?i", ucwords($p_info['product']), $p_info['product_id']);
    $affected += db_query("SELECT ROW_COUNT()");
    $cnt++;
  }
  die("Modified '$affected' names of '$cnt' products");
}
You'd use this like: [your_domain_admin_url.php]?dispatch=my_changes.uc_product_names
 
It should output something like:
Modified '126' names of '223' products.
 
Note: the db request was updated.  It should have been db_get_array not db_get_row

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.