robgt

Turn option back on to select categories when adding products to listing

Recommended Posts

I seem to have turned off (ticked the box) the option to select ebay store categories for products being added into a listing, and I cannot find where/how to turn it back on again?

This means that all products I add to the listing are being added to the same ebay store category as the first bunch of products added to that listing.

How do I get that dialogue back to choose new ebay store categories when adding new products to an existing listing?

Cheers!

Share this post


Link to post
Share on other sites

I believe I have found where this tick setting is stored in the database, but I can't quite see how to undo it.

In table: m2epro_listing > additional_data there are what appears to be some default settings in what looks like JSON format. But what I might have to remove from that, I am unsure?

Any pointers gratefully received.

Cheers,

Rob

Share this post


Link to post
Share on other sites

As a test, I simply removed all the contents of that field in the database (having made a copy of it first), and tried adding a product to the listing.

Oddly though, not only did this not fix the issue, but also that same JSON data reappeared in that database table column, with exactly the same data in it as before, including create and update dates beingfrom a week ago (when I first created this listing).

Now I scratch my head...

Any ideas anyone?

Cheers,

Rob

Share this post


Link to post
Share on other sites

Hi Rob,

The reason why the same data reappeared in the database column is because it was cashed and remembered initially. The listing details get cached. When you cleared 'additional_data' and started adding the products, the initial listing data was uploaded from the cache. That is why you have to clear cache in such and similar cases. 

To reset the saved listing configuration for ALL the listings, you can use the following code snippet 

$collection = Mage::getModel('M2ePro/Listing')->getCollection();
$collection->addFieldToFilter('additional_data', array('like' => '%mode_same_category_data%'));

$i = 0;
foreach ($collection->getItems() as $item) {
 /* @var Ess_M2ePro_Model_Listing $item /

 $additionalData = json_decode($item->getData('additional_data'), true);
 unset($additionalData['mode_same_category_data']);
 $item->setData('additional_data', json_encode($additionalData))->save();

 $i++;
}

var_dump($i);

 

It won't delete all the 'additional_data', but only the requested fields. 

Share this post


Link to post
Share on other sites

Hi Anna,

Thanks for the code snippet, and of course the cache reminder!!

Is the code snippet to be added into a specific place in the system, or simply run in isolation to perform the update once? It reads to me like it's a run once thing in its own script, but wanted to check first! :-)

Cheers,

Rob

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.