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.

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:

Static Site Generators and Github Pages

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

Customizing Optional Payment Method for Zen Cart

My Optional Payment Method for Zen Cart mod allows you to configure a payment module so that it is only available to certain customers.  But what if you want it available for purchases over a certain amount as well?  Here’s the code to add to the payment method of the payment class.  Right above where the mod has you add

 // bof optional payment module logic

change this to

 $payment_threshold = 400;
 global $order; 
 // Enable if total > threshold.
 if ($class_ok->fields['optional_payment_1'] != 1) {
    if ($order->info['total'] >= $payment_threshold) {
       $class_ok->fields['optional_payment_1'] = 1;
    }
 }
 // bof optional payment module logic

This turns it on for all transactions over $400. To turn it on for all transactions over $400 AND where the customer has been configured to use the payment method, do this instead:

 $payment_threshold = 400;
 global $order; 
 // Enable if total > threshold AND customer enabled
 if ($class_ok->fields['optional_payment_1'] == 1) {
    $class_ok->fields['optional_payment_1'] = 0;
    if ($order->info['total'] >= $payment_threshold) {
       $class_ok->fields['optional_payment_1'] = 1;
    }
 }
 // bof optional payment module logic

Interesting application for Zen Cart Better Together Admin and Checkbox Cross Sell

A client wanted to use Better Together Admin for Zen Cart to configure cross sells, and wanted to use Checkbox Cross Sell for Zen Cart to display them.  Easy enough – but here’s the twist: he wanted any cross sell to be applied to all products (rather than configuring each product with the same cross sells).

This kind of thing can be done with just a little custom programming.  On my Advanced Discount Configuration for Zen Cart page, I show how to do it (see example 11).