Interchange: Changing the shipping price on individual items
This was the problem I was posed with the other day. I knew right off the bat that it was going to be a doozy, even though very practical and necessary to know when working with an online store.
A customer wanted to change the shipping prices for his store in the following fashion;
First item = $Example Price 1
Every item after first item = $Example Price 2
Now, you may or may not know (because let’s not forget, this is interchange and barely anything makes sense) where to change the base shipping price. I am going to tell you how to do that first, so at least you know where that is in your admin
interface.
Let’s Start
Step 1: Log In to your control panel. You can’t do much without knowing how to do this (type in your site address and add /admin/login. I always think of the order of “login - admin” in the address line as, where do I want to go? = Admin, what do I want to do in the admin = Login.)
Step 2: Once logged in, click on the “Administration” tab, the second to the last on the upper right.
Step 3: At this screen, you will see “Edit Preferences” with a whole list of items in four columns. In the far right column you will see an item called “Shipping“.
Step 4: You will see a list here of variables, you are looking for the one entitled “SHIP_FLAT_DOM_RATE“. Click
this link.
Step 5: Change “Preference Value” to whatever you want your shipping amount to be. I am going to change mine to $3.50.
Step 6: Like always, Apply changes to update the configuration and database.
So, to recap. In this case, $3.50 = Example Price 1. For every other item beyond the first one, I want to charge $1.95, or Example Price 2.
This is where things get a little more interesting and even less intuitive.
In your filing structure for your website you should have a folder called products and a file called “shipping.asc“. This is the file you need to edit. If you are using Dreamweaver to publish your files, you will have some issues with this. An Administrator who knows command line access for the server will have to access the file for you. The shop has permissions set on this file that will more than likely prevent you from downloading it to your local machine and edit it in Notepad or another text editor.
Explaining editing a file in “vi” or something else at command line is beyond the scope of this entry. I hope that you can figure that out on your own. But, in this tab delimited file you will see a number of columns with entries. Some of the data kind of looks like this;
- FLATD Flat rate quantity 0 0 e Nothing to ship!
- FLATD Flat rate quantity 1 100 f [var SHIP_FLAT_DOM_RATE]
- FLATD Flat rate quantity 100 9999 e Contact factory to ship that many.
You recognize the variable here, don’t you? I bolded it for those of you who can’t see it. This is where you have to tell those items ordered more than one to be charged differently. Now, I will admit, I did not figure this out for myself. I understand it, but I am in the end, more of the pretty guy that the technical, and my coworker Chris figured it out, he’s the programming wiz.
This is what you would have instead.
- FLATD Flat rate quantity 0 0 e Nothing to ship!
- FLATD Flat rate quantity 1 1 f [var SHIP_FLAT_DOM_RATE]
- FLATD Flat rate quantity 2 9999 f [var SHIP_FLAT_DOM_RATE] + ((@@TOTAL@@-1) * 1.95)
So, what is going on here? You are changing the ranges for the values. Notice in the first example there were ranges from 0 -0, 1-100, & 100-9999. In the second example we have 0-0 still, but we have change the second value to 1-1 with the SHIP_FLAT_DOM_RATE variable. So, whatever price you have set for that variable, will be the price for the first item.
Then, for all items after 1, or 2-9999, the shipping will be calculated like this;
SHIP_FLAT_DOM_RATE + ((@@TOTAL@@-1) * 1.95. What this says is add the base shipping rate once, for the first item, to the total of items minus one (the first item which has shipping of $3.50) multiplied by $1.95. Pretty easy huh?
Well, this was made too look easy once it was figured out. That is kind of how things go in Interchange. They can be easy to figure out, but only after you find what and where you need to edit.
Here are some similar arcade posts
- How do I change the product order in the vertical category component?
- Working with Interchange config files between Homesite and Dreamweaver.
- Value of NOS Mappy and Food Fight bezels
- Introduction to understanding Interchange, Open Source Ecommerce solution
- How to I change a variable to a Boolean Value? What is a Boolean Value?
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.











Comments
No comments yet.
Leave a comment