Dspooner Posted February 25, 2014 Share Posted February 25, 2014 Hi i would like to upload a product list to a coupon but i cannot see how i can do this. we are on version Script Version 5.2.2 PHP Version 5.2.14 MySQL Version 50525 Image folder size 207.5 KB thanks daniel Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 25, 2014 Share Posted February 25, 2014 In what manner will the 'upload' take place? The list of products to include, or the list of products to exclude are run through PHP's serialize() function. The result as seen in the CubeCart_coupon database table is of the format: a:2:{i:0;s:7:"exclude";i:1;s:1:"1";} That is: an array with two elements comprising of: index 0; string of length 7: "exclude"; index 1; string of length 1: "1"; (<- the product_id) The other columns in the coupon table are straightforward. (If there is a value in the cart_order_id column, then this is actually a Gift Certificate.) Quote Link to comment Share on other sites More sharing options...
Dspooner Posted February 25, 2014 Author Share Posted February 25, 2014 Hi Its a list of products i want to exclude so do i just put these in a excel file and were do i upload the file? thanks daniel Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 25, 2014 Share Posted February 25, 2014 "Do I just put these in an Excel file, and were do I upload the file?" Excel can be used to create a CSV file, and while in Excel, the spreadsheet will look like this: 1 | status | code | product_id | discount_percent | discount_price | expires | allowed_uses | min_subtotal | count | shipping | description | 2 | 1 | ABC1 | a:2:{i:0;s:7:"exclude";i:1;s:1:"1";} | 0.00 | 10.00 | 2014-04-30 | 10 | 0.00 | 0 | 0 | Coupon Named ABC1 | 3 | As discussed earlier, the serialization of the 'product_id' column needs to have the proper format. Then, the CSV file that Excel will save this spreadsheet as, you can have phpMyAdmin import that file into the CubeCart_coupons table. Quote Link to comment Share on other sites More sharing options...
Dspooner Posted February 26, 2014 Author Share Posted February 26, 2014 Hi so for the product_id colum if my SKU is CC12345 a:2:{i:0;s:7:"exclude";i:1;s:1:"CC12345";} would thius be right ?? thanks dan Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 26, 2014 Share Posted February 26, 2014 In admin, go to Products. View the Product Inventory list. Hover the mouse cursor over the name of a product. Your browser should indicate in some manner the web address the link points to. For example: hllp://www.store.com/admin.php?_g=products&sort%5Bupdated%5D=DESC&action=edit&product_id=3 It is the 3 that is the product_id and it would be the 3 that would be in the serialize string: a:2:{i:0;s:7:"exclude";i:1;s:1:"3";} A serialed string that excludes three products would be: a:4:{i:0;s:7:"exclude";i:1;s:1:"3";i:2;s:1:"7";i:3;s:2:"18";} meaning, exclude the products where the product_id is 3, 7 and 18. And not that the serialized array now has 4 elements. The SKU being "CC12345" is known to CubeCart as the product's product_code. Quote Link to comment Share on other sites More sharing options...
Dspooner Posted February 26, 2014 Author Share Posted February 26, 2014 Hi I get what you mean now in regards to getting the product id from cubecart is there a way to do this on mass??? thanks daniel Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 26, 2014 Share Posted February 26, 2014 You could try using phpMyAdmin to get a CSV dump of the CubeCart_inventory table. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.