Better Together is a BOGO discounting module I created for Zen Cart. I have ported the logic to a few other carts (osCommerce, Prestashop, and OpenCart), and this post pertains to the OpenCart port.
The first release of the Better Together for OpenCart module was for OpenCart 1.5. Then I made a handful of tweaks for compatibility with version 2.0. Now I knew I had to upgrade for 2.3 compatibility, but since the version 2 changes were pretty easy, I honestly thought upgrading for version 220.127.116.11 of OpenCart would be trivial. I was wrong! There were a few tricky things, and I’ll share them here in case other software developers are working on upgrading their pre-2.3 extensions.
- The file paths are different. All file paths now include “extension” directories. So instead of
catalog/model/total/better_together.php, the file path becomes
- The inheritance hierarchy is different. So instead of declaring your model class as ModelYourClass, it’s ModelExtensionYourClass, which extends Model.
- This is what really tripped me up. Because the 2.3 base class overrides getters and setters, you have to be sure to declare all your class variables so that magic methods won’t be used to access them(*). If you came out of PHP4, this is a bit of an adjustment, but there you are. The positive thing is that it makes your code more self-documenting.
(*) If you don’t do this, you’ll get the “Indirect modification of overloaded property has no effect” fatal error.
Extended Family joins Zen Cart Free Gift Chooser and Zen Cart Free Gift Spender as modules that required MySQL 5.7 compatibility changes. Please get these updates if you use these modules.
Newsletter Discount for Zen Cart has a few new features:
- Dollar off per order setting
- Caching of Mailchimp subscriber status
If you are willing to send multiple newsletters every month (I think the minimum cadence should be monthly), and you want to do some market segmentation, you may want to try this technique. It assumes you have already installed my Mailchimp Integration for Zen Cart.
- Login to Mailchimp and click the Lists menu at the top. Then on the right, click the Stats dropdown and select Signup forms.
- Click the Select button on Embedded Forms.
- Under Manage Contacts, click Groups.
- Click the Create Groups button, and add Checkboxes and Radio buttons as need be. You can add many Groups, so don’t be afraid to partition your questions.
- Click Signup Forms and Embedded Forms again. The code for the form shown in the preview is right below the preview window. Copy this code and paste it into a new page (or sidebox) on your site.
You can read more about creating groups on the Mailchimp Getting Started with Groups page.
So after a while you’ll (hopefully!) have some newsletter signups, with people identifying as being part of one group or another. How do you utilize this data?
- Select Campaigns, name the campaign and make it a regular campaign.
- You will be prompted to select Recipients. Select Group or New Segment.
- Use the query-by-example form to select the target group for your campaign.
You can read more about this on the Mailchimp Sending to Groups page.
As a convincer, see the email signup form we are using on keylessentrylocks.com:
There was a bug in the subscriber check in the discount logic which has just been fixed; please update to version 4.0b, which is available in the Zen Cart downloads area. Links and documentation are on the Zen Cart Newsletter Discount Help page.
Zen Cart Free Gift Chooser and Zen Cart Free Gift Spender have just been updated for compatibility with MySQL 5.7.
In addition, Free Gift Chooser now offers the ability to condition on *any* category. So deals like, “With any purchase, get a free <item>” are now possible.
If you’re getting this warning message in your ZenCart checkout using Paypal Payments Standard, fear not! There issue is just that Paypal is no longer using commas in the payment amount, and there’s a fix for it. The options are described in the Zen Cart forum thread PayPal deleting the comma from PayPal Standard in Jan 2017.
The mighty Googs have changed how their redirection works, so that search parameters are no longer passed to target pages. For this reason, my Zen Cart Welcome Google Searcher mod will no longer work.
I told you a while ago about my experience building a static site with Hugo. I was updating the page to show a few changes (notably to my book group website, but also to update the year in the footer). I stumbled upon a small bug in Hugo’s date reporting, but the real issue that caused me to waste a ton of time was that in my aggravation, I wound up deleting the
public folder to ensure a clean start. But in a Github Pages based site, the
public folder should really be a separate Github repo pointing to your target site!
So now I do a quick check in my deployment script to make sure I haven’t accidentally done this again. Be sure you do something similar!
Note: If you are using Jekyll instead of Hugo, the same advice applies, but you’ll want to check
_site instead of