Discount Chooser for OpenCart

I have said for some time that I’d do a discounting module for OpenCart that included an admin panel.  Well, I’m finally working on it.  It’s basically Free Gift Chooser, but I used a different name to signal that you could do discounts as well as free offers.  So for the next little while I’ll be blogging about the progress of Discount Chooser for OpenCart.

The eternal question: how can I increase business?

A friend of mine asked me this the other day, and I wanted to share my response in case it helped others wondering the same thing.

  • Are there seminars, conventions or meetups you could speak at?
  • Are there blogs you could guest blog on?
  • Are you posting YouTube videos of uses for your product?
  • Can you partner with brick and mortar establishments?
  • Are there forums you could participate in to establish your expertise? For example, is there a StackExchange forum for your type of business?
  • Can you segment your business into vertical markets and target one or two of those specifically?
  • Have you asked existing customers for testimonials and referrals?  How about video testimonials?  Everyone has a smartphone nowadays, and making a video is a snap.  You can host videos on your YouTube channel.
  • Where do your customers go?  Can you go there?

Better Together for Zen Cart Updates

Back in 2013 I extended the one-to-one linkage concept in Zen Cart Better Together with the One-to-Many feature.  This addition of three new radio buttons in the Zen Cart admin panel effectively tripled the number of permutations of computed discounts.  What could go wrong?

Well, as it turned out, a number of things!  Freed from the classic one-to-one constraint, the configuration

add_prod_to_prod(3,3)

would discount a *single* product 3, because it miscounted the number of items in the cart.  You can see this error in the screenshot above.

This bug is fixed in Better Together 2.5.3 for Zen Cart, which is available in the Plugins area.

Sending files as attachments using GMail

If you send files around using your GMail account, you may have noticed an increase in the number of false positives in their attachment scanner.  Files of type .php and .js are frequently incorrectly identified as malicious, and the attachment is blocked.

Fortunately, there is still a straightforward way to get around this – rename the file so the filetype is different – rename .zip files to .zip.file, for example.

Here’s a decent discussion of this topic:

Trick Gmail Antivirus Scanner: Send Any File Type with Gmail. (.exe, .dll, .com, .bat)

2 series Mastercards and your Zen Cart

You may have already heard that Mastercard is rolling out cards that start with a “2” instead of the traditional “5.”  You’ll want to check your version of Zen Cart to be sure you can handle this.  Versions 1.5.5b and above have built in logic for the native payment methods (such as Authorize.net); if you are running a lower version, you will need to merge in the changes from the latest copy of includes/classes/cc_validation.php.  If you are using an extension to manage credit card payments, be sure to test with Mastercard 2223000048400011.  Then you can have confidence that your cart properly processes “2” series Mastercard cards.

Upgrading Better Together for OpenCart 2.3.0.2

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 2.3.0.2 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.

  1. 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 catalog/model/extension/total/better_together.php.
  2. The inheritance hierarchy is different.  So instead of declaring your model class as ModelYourClass, it’s ModelExtensionYourClass, which extends Model.
  3. 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.

Marketing Text Improvements Free Gift Chooser, Free Gift Spender for Zen Cart

The Zen Cart Free Gift Chooser Marketing Text and Zen Cart Free Gift Spender Marketing Text have both been improved. In the old format, they would simply indicate the category and product IDs, as is done in the admin panel. This wasn’t very customer friendly, so I updated them to use links instead.

So now, instead of

Spend $50.00 in any category, Get 1 Comedy (CAT 12) free.
Free Gift Spender marketing text looks like this:

Spend $50.00 in any category, Get 1 Comedy free.

and instead of

Buy 1 from category DVD Movies (CAT 3) , Get 1 from category DVD Movies (CAT 3) free.
Free Gift Chooser marketing text looks like this:

Buy 1 from category DVD Movies, Get 1 from category DVD Movies free.

Capturing and Filtering on Interests in Mailchimp

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.

  1. Login to Mailchimp and click the Lists menu at the top.  Then on the right, click the Stats dropdown and select Signup forms.
  2. Click the Select button on Embedded Forms.
  3. Under Manage Contacts, click Groups.
  4. 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.
  5. 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?

  1. Select Campaigns, name the campaign and make it a regular campaign.
  2. You will be prompted to select Recipients.  Select Group or New Segment.
  3. 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: