Rob's Ramblings

Tuesday, 6 January 2015

How to annoy your users.

1. Use percentages to decide if a seller is "top rated" or "below standard".  Never mind that fact that a high volume seller can create 100 unhappy customers without even dropping a feedback percentage point, and keep their "top rated" status, but just a couple of mistakes by someone who manages to sell a few dozen times a month means they are damned for all eternity.  Where does "protecting the customers" feature in that?  High volume = piss off as many people as you like; we don't care.

Particularly annoying since the mistakes were caused by a third party (official!!!!!) software we used over-selling items. I could thus justify a "Not Our Fault" as it's not easy to keep track of over 1000 items manually, which was why we wanted to automate it!

2. Stop that small seller from listing any more items, so they don't have a hope in hell of raising their performance levels again whilst still charging them £60 per month for the shop they now can't use.

3. Restrict the seller's own personal account as well, because they are "linked" even though they are plainly used for totally different purposes.

4. When the seller attempts to contact you about the personal account, reply back telling them that their user-id violates their user-id policy, despite it having been used unchanged for nearly 15 YEARS, and if  they don't change it immediately, it will be changed for them, and cannot then be changed again for a further month.

I think that after 15 years, it is at the very least an implied contract term that they find the name acceptable.   Particularly as we have been in contact several times before this incident over unrelated matters!

5. Refuse to discuss even the possibility of compromise.   Refuse to even close the accounts when asked to do so.  Because they can't close an account that is restricted until it's performance is raised. Which it can't do because WE CAN'T SELL ANYTHING!  aaarrrrrrrrrrgggggggghhhhhhhhhh!!!!


I'll have to add up the figures, but I think the business actually LOST money trying to sell on eBay recently.  Sales have been low, with not enough gross receipts to even cover their fees, never mind cover the cost of the goods sold and make a profit out of it.  


I want to swear very loudly and break something.  This post will have to do for now.

Labels: , ,

Saturday, 26 October 2013

Prestashop - deleting redundant images.

One of the things I wrote when I first set up a webstore using Prestashop was a product import routine from one of our suppliers, that created the initial products.

Among other things, this included all the images for the product.

Now, the supplier provided separate thumbnail and large images in their links, which were dutifully imported. So each product ended up with two apparently identical images, but the second was bigger than the first! I'd not really bothered to clean this up, as it didn't really affect anything.

Now however, with eBay's new picture standards in the offing, and the standard prestashop eBay module being somewhat.. um... inflexible... (more on my work on this at a later date!) I've realised that I need to get rid of all these unnecessary images.

The end result is the rather simple little module below.  This will appear in the "Other Modules" category.  Once installed, and configure pressed, it will present you with a load of images!

Where a product has two (or more) images, numerically in sequence (so they were created at the same time) and the first is the cover picture, it will show the first two.  Alongside each pair is a checkbox, already ticked.

Scroll down .. If the pictures are the same, leave it ticked. If they are different, clear the tick.

If you press the submit at the bottom, it will delete the first image from the product for each line that you leave ticked.

This does for me.  It may not do for you.  Put your store into maintenance mode and make backups of your filesystem AND database before you even install this.  I offer this with no warranty whatsoever.  Do not complain if it all goes horribly wrong - just restore and then work out why.

Download ImgClean 1.0 here.

Labels: ,

Friday, 9 August 2013

Prestashop - switching to shared stock.

Another useful tid-bit of information.

If you use Prestashop for your online e-commerce, then you may be aware of their "Multistore" feature - basically, you can use the same installation to run completely different shops; the difference being the URL you access them from.

So what, you might think. That's not really much more use thant just running two copies on different virtual hosts. Well, the strength is that you can share products, customers, stock levels, discounts, pretty much everything ... if you want to. Plus, of course, it's only one installation to keep up to date.

Great, this suited an installation I did a while back. Unfortunately, although the products were set as shared across all stores, somehow in the several iterations of testing the option to share stock levels was not. Since the vast majority of products are unique to each store, with only a few cross-overs, nobody noticed, until now.

OK, simple, we thought.  Switch the option on now.

Share available quantities between shops of this group. When changing this option, all available products quantities will be reset to 0.

Eek... all quantities will be reset to zero....

Not what we want at all.

Checking the code, we see that yes indeed, when changing this setting, sure enough, it deletes everything from the "stock_available" table for the affected shops.

The stock_available table has two relevant fields in it - id_shop and id_shop_group.

When stock is held for an individual shop, the first is filled in, and the group is zero.  When it's shared between a group of shops, it's the other way around.

Since the only table affected when you do the switch is the stock_available one, it seems logical therefore that this is the only source of data that we need to preserve.

Much testing in my sandbox shop therefore resulted in the following bit of code necessary to preserve the stock across the change.  READ ON BEFORE TRYING THIS OUT!

update ps_stock_available set id_shop_group=1, id_shop = 0;

Yep!  All we need to do is update the group field, and clear the shop field!  Of course, if you have more shops that you don't want affected, you should include a "where" clause to restrict whose products this affects.

You need to do this before you change the shared stock setting.  Also, it will fail if you have any products with stock held individually.  This code will list any of these -

select p.id_product, pa.id_product_attribute, count(sa.id_shop) as shops
from ps_product p LEFT JOIN ps_product_attribute pa ON (pa.id_product = 
p.id_product ) JOIN ps_stock_available sa on p.id_product = sa.id_product 
and sa.id_product_attribute = IF(pa.id_product_attribute IS NULL,0,
pa.id_product_attribute) group by sa.id_product, sa.id_product_attribute  
having count(*) > 1;

Yep, that's a bit longer, sorry!  It's got three tables to cross-reference.

It it comes up with any, this code will tell you more about which stores an item is held in, and how much is in each store, etc -

select * from ps_stock_available where id_product = 782;

(That's for product #782, of course - adjust as necessary!)

If, as I found, the products had zero stock in the secondary stores, you can just delete all but one of the records -

delete from ps_stock_available where id_product = 782 and id_shop <> 2;

Re-run the check again, then do the conversion.

This is easiest, of course, from the mysql command line, but if you use a web-based tool, you should be able to manage if it will accept typed mysql command lines.

I should give you the obvious warnings -

BACKUP YOUR DATABASE FIRST!!  Preferably using outside tools such as mysqldump
Then examine the backup file - does it look like it holds all your data??
PUT YOUR SHOP INTO MAINTENANCE MODE. You don't want customers confusing things.
TEST IT THOROUGHLY. If you are not convinced everything is right, restore from your backup!

Labels: , ,