Jump to content

Adding new carrier to items in bulk


cmugume

Recommended Posts

  • 2 years later...
  • 1 month later...

You can run a query like
 

 
            $data = array(
                'id_product' => (int)$id_product,
                'id_carrier_reference' => (int)$id_carrier,
                'id_shop' => (int)$id_shop
            );
         Db::getInstance()->insert('product_carrier', $data, false, true, Db::INSERT_IGNORE);
 
 
I didn't test it, but anyway make sure you replace variables. Backup the table before
  • Like 1
Link to comment
Share on other sites

@bala.k: Then the short answer is: you can't.

Super - Why dont you guys do something bout that - if I have 5000 Products of which 2000 are available in Country X where I have tied up with a carrier of that country - What do I do?? Opening all 2000 products and adding the carrier - Does not seem logical solution and its very time consuming. Adding to that I am not a programmer..Appreciate if some one develops a patch or something. Thanks

Link to comment
Share on other sites

Super - Why dont you guys do something bout that - if I have 5000 Products of which 2000 are available in Country X where I have tied up with a carrier of that country - What do I do?? Opening all 2000 products and adding the carrier - Does not seem logical solution and its very time consuming. Adding to that I am not a programmer..Appreciate if some one develops a patch or something. Thanks

You? Who? I am not in the prestashop team, otherwise I would.

If you are happy to pay for a premium addon, it's another story, since "we guys" are contributors.

 

@Tuffnet: I will hopefully come up with a tutorial one of these days

Edited by Nemo1 (see edit history)
Link to comment
Share on other sites

Hi

 

i solve my own problem with dumbing ps_product_carrier.sql and .csv

then removed dublicates from colum1 and then chanced that colum2 where are carrier id to new.

then save it 2.csv

open ps_product_carrier.sql with notepad++ added that 2.csv with copypaste + little edit.

then added it back to mysql.

Hopely some day there will be easyer to add bulk carrier

Link to comment
Share on other sites

Hi

 

i solve my own problem with dumbing ps_product_carrier.sql and .csv

then removed dublicates from colum1 and then chanced that colum2 where are carrier id to new.

then save it 2.csv

open ps_product_carrier.sql with notepad++ added that 2.csv with copypaste + little edit.

then added it back to mysql.

 

Hopely some day there will be easyer to add bulk carrier

mmm, Thanks Will try this out.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
  • 3 months later...

Thanks a lot, it's a time saver.

If someone is looking for a simple solution to remove any existing carrier from products (in order to make all carrier available for shipping selection), you just have to empty the product_carrier sql table.

YOURDBPREFIX_product_carrier

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

Hello nemops,

 

Sadly no, the configuration is broken, I can't select any category  as you can see on this picture :

 

post-603134-0-18977700-1481311250_thumb.jpg

 

I also tried to add a carrier to a product with the product number and I got this error message :

 

[PrestaShop] Fatal error in module AdminController:
Class name must be a valid object or a string

 

Can you take a look to make it 1.5 compatible ?

Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...
  • 2 months later...
  • 3 months later...
  • 5 months later...
  • 2 weeks later...
  • 2 months later...
On 10/20/2018 at 4:31 PM, NemoPS said:

Well not as it is, you'd have to edit the method and loop through an array instead of using a single value (it's enough to set the multiple attribute for the select box, then edit the postProcess method

Thank you Nemo, unfortunately my php programming capacities are not enough to implement your suggestion.

 

Link to comment
Share on other sites

  • 3 months later...
  • 9 months later...
  • 1 month later...

I changed the association of products and carriers directly in db, but the changes I made do not appear in the store. The information in the table is correct. How do I get prestashop to update the data I entered directly in db? It seems that this is a recurring problem.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 3 weeks later...
On 3/24/2020 at 5:36 PM, dolec said:

I dont see all carriers despite they are active some help?

Have you added specific configurations in carrier like weight, amount, etc.? If yes then check those products which suitable your configuration to particular carriers.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 1 year later...
  • 11 months later...

@El Patron

I did as you suggested and truncated table ps_product_carrier on my dev server. The problem I have now is, it appears that no carriers are available and no products visible in the FO. I have therefore did a test and created a carrier especially for the country where I'm. Nothing - no products (yes, all possible caches deleted and testing on Chrome, incognito, hard reload). Next step I did, I enabled that my specific carrier under product settings (product level associated shipping) and the product became visible to me and I could see its entry in db. I truncated ps_product_carrier again and the product was still visible despite the fact it has no carriers selected under product settings.

Any idea please what could be causing it and how to nail it down? I would rather have all product level associated shipping removed instead of enabled.

Link to comment
Share on other sites

3 hours ago, mr_absinthe said:

@El Patron

I did as you suggested and truncated table ps_product_carrier on my dev server. The problem I have now is, it appears that no carriers are available and no products visible in the FO. I have therefore did a test and created a carrier especially for the country where I'm. Nothing - no products (yes, all possible caches deleted and testing on Chrome, incognito, hard reload). Next step I did, I enabled that my specific carrier under product settings (product level associated shipping) and the product became visible to me and I could see its entry in db. I truncated ps_product_carrier again and the product was still visible despite the fact it has no carriers selected under product settings.

Any idea please what could be causing it and how to nail it down? I would rather have all product level associated shipping removed instead of enabled.

Hi, I did not really recommend truncating ps_product_carrier as a method to achieve but can understand why this approach would be investigated.  It's best practice to have a dev shop to first try change....I would not truncate a table without first testing on a dev.  Please post back here the info from the private message you sent as I don't work in private messaging.  Thanks

Link to comment
Share on other sites

Thanks for your reply. I share your opinion of not truncating a table on a production server without testing first. That is why I have this on my dev server. If you do not recommend truncating ps_product_carrier as a method to achieve removing all product level associated shipping, how else should it be done? One by one in product setting? Possible if you have a few but not for hundreds of products. The only additional info to explain / describe the issue is the video.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...