Forum

Thread tagged as: Problem, FoxyCart

FoxyCart category problem

I have setup two categories on FoxyCart - one called 'catbox' and one called 'boxdvd'

When I try to enter these into my shop backend in Perch and click save, the value disappears.

Any fixes?

Thanks

Chris McGuicken

Chris McGuicken 1 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you a dd the following line to your perch/config/config.php file.

define('PERCH_DEBUG', true);

and then let me know what it outputs when the value 'disappears'?

Hopefully this makes sense

DIAGNOSTICS:
SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r
WHERE u.roleID=r.roleID AND u.userEnabled='1' AND u.userID=1 AND u.userHash='e3379e5f051093fa229fe3bc79e78f6c'
LIMIT 1
UPDATE perch2_users SET userHash='2159abc28e7b7a030910de8a53bfc968' WHERE userID=1
SELECT p.privKey FROM perch2_users u, perch2_user_role_privileges rp, perch2_user_privileges p
WHERE u.roleID=rp.roleID AND rp.privID=p.privID AND u.userID=1
SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
SELECT * 
FROM perch2_shop_categories ORDER BY categoryTitle ASC
SELECT * FROM perch2_shop_products WHERE productID=4
SELECT categoryID FROM perch2_shop_products_to_categories WHERE productID = 4
SELECT c.*
FROM perch2_shop_categories c, perch2_shop_products_to_categories p2c
WHERE c.categoryID=p2c.categoryID
AND p2c.productID='4'
Using template: /templates/shop/product.html
Queries: 9
Drew McLellan

Drew McLellan 2638 points
Perch Support

And that's after submitting the form? I can't see anything being updated at all, which is a puzzle.

Yip, I go to Apps > Shop > Choose a product > Type in the foxycart cat id (in this case 'catdvd') and click save. The text box then returns empty...

I've cross checked all templates etc to make sure everything is where it should be and I cant find anything. I did change the shop from PayPal to Foxy but all seemed to transfer across and my cart does actually work fine: https://www.rpm.designbyconet.com/shop/category.php?cat=specialist

Is there any info I can provide you with to look into this?

Drew McLellan

Drew McLellan 2638 points
Perch Support

When you changed from PayPal to Foxy, did you remove the database tables so it could install fresh?

Nope! What tables exactly do I need to remove?

Cheers

Drew McLellan

Drew McLellan 2638 points
Perch Support

The two shop apps use the same table names but different table structure. If you have one apps tables with the wrong set of code you'll get errors. Best remove the app and start again, unless you have a lot of data.

Yeah I have about 100 products which I really hoped I wasn't going to have to enter again but it looks as though I might have to then?

Drew McLellan

Drew McLellan 2638 points
Perch Support

We can probably work around it. Can you create a mysqldump of the structure of your current shop database tables? Then I can see what needs to be changed.

Hey Drew, just sent a private ticket, didn't want to post the link to my sql dump on a public forum... awaiting you reply :)

Drew, did you get my email OK?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, and I'll take a look at it as soon as time allows.

That's great, thanks, just the customer is on my back and this is the only thing holding it up.

Thanks again

Drew, I still havent heard back from you - slightly disappointing. I am going to have to delete the shop tables, reinstall foxy cart and reinstall all of the products as the client needs this to go live this week.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok that's fine. I was hoping to look at this today or tomorrow, but you do what you've got to do.

I'm not sure it's quite justified to feel disappointed - this is way beyond the scope of Perch support, and I was simply trying to do you a favour to help out. But never mind.

Drew, I really do appreciate all your help up to this point I am just getting tortured by the client and under pressure. If you can look at this today, do please let me know as I am sure I can hold off for another few hours, if not I will go on ahead and delete everything and start again.

Thanks again

Drew McLellan

Drew McLellan 2638 points
Perch Support

Make a backup, then try running these SQL statements to change the DB structure:

ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderPayerPhone` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderPayerEmail`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderPayerID` `orderPayerID` varchar(64) CHARACTER SET utf8 DEFAULT NULL after `orderPayerPhone`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderCurrency` `orderCurrency` char(3) CHARACTER SET utf8 DEFAULT NULL after `orderPaymentStatus`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderCompany` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderLastName`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderAddressName` `orderAddressName` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderCompany`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderAddressStreet` `orderAddressStreet` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderAddressName`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderAddressCity` `orderAddressCity` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderAddressStreet`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderAddressState` `orderAddressState` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderAddressCity`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderAddressCountry` `orderAddressCountry` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderAddressState`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderAddressZIP` `orderAddressZIP` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderAddressCountry`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingFirstName` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderAddressZIP`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingLastName` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingFirstName`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingCompany` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingLastName`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingAddressStreet` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingCompany`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingAddressCity` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingAddressStreet`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingAddressState` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingAddressCity`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingAddressCountry` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingAddressState`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingAddressZIP` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingAddressCountry`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingEmail` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingAddressZIP`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderShippingPhone` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingEmail`;
ALTER TABLE `perch2_shop_orders` ADD COLUMN `orderReceiptUrl` varchar(255) CHARACTER SET utf8 DEFAULT NULL after `orderShippingPhone`;
ALTER TABLE `perch2_shop_orders` CHANGE COLUMN `orderItems` `orderItems` text CHARACTER SET utf8 DEFAULT NULL after `orderReceiptUrl`;
ALTER TABLE `perch2_shop_products` ADD COLUMN `productFoxyCategory` varchar(255) CHARACTER SET utf8 DEFAULT '' after `productPriceByOptions`;

Drew, that's it! Absolutely FANTASTIC!

Thank you so, so much. Should never have doubted you. Many thanks.