Press "Enter" to skip to content

Tag: sql

Bug Report [Fixed]: WordPress Plugin “miniOrange Broken Link Checker” syntax errors

In an effort to prove to myself that I am actually trying to do work this month, I’m making a note of all the bugs in 3rd party software I find.

Today is a bug reported the developers of the miniOrange Broken Link Checker | Finder WordPress Plugin on the 11th June 2022 through the WordPress plugin forum about database syntax issues being caused in the version 2.1 of that plugin.

Magento: Associating customer accounts

If you run a Magento e-commerce store, you may occasionally find existing customers placing orders without being logged into their account. This isn’t a problem usually, unless the customer is one of those vary rare ones which actually logs into the customer frontend to track/check their order(s). If they weren’t logged in, they won’t see the ecommerce order.

So how do you fix this? Well, there is a Magneto module available to do this, but (as is increasingly common in the Magento world) it costs $99. Or there is my way which is free and requests two SQL statements:

UPDATE sales_flat_order, customer_entity
SET sales_flat_order.customer_id=customer_entity.entity_id
WHERE
sales_flat_order.customer_email=customer_entity.email

UPDATE sales_flat_order_grid,sales_flat_order
SET sales_flat_order_grid.customer_id=sales_flat_order.customer_id
WHERE
sales_flat_order_grid.increment_id=sales_flat_order.increment_id

Done.

Snippet: ClickCartPro: Extracting VAT Exempt orders

If you are looking for a way of listing all orders in Greenbarnweb/Kryptonic’s ClickCartPro software that is exempt from European/UK VAT, then you may find the following SQL query useful:
SELECT `id` , `dateday` , `datemonth` , `dateyear` , `ordertotal`, `eutaxrefundtotal` , `country` FROM `gbu0_orders` WHERE STATUS = 'C' AND (eutaxrefundtotal >0) ORDER BY dateyear DESC , datemonth DESC