Browsing all articles in Interchange

Interchange: Changing the shipping price on individual items

Posted Posted by jerothe in Interchange     Comments No comments
Oct
31

Rothe Blog Interchange LogoThis 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.

How do I change the product order in the vertical category component?

Posted Posted by jerothe in Interchange     Comments No comments
Aug
12

Rothe Blog Interchange Logo
As I always assume you know Interchange some already, I will also assume that you are relatively familiar with the predominant category vertical component that is in the base store and is usually located on the left side of the homepage. There is a certain order to which those products display, and that order may be important for your targeted users. You may want them to see Strawberry Jam before they see Orange Preserves.

The change you need to make is in the admin interface. I could go into a big explanation of how to log in, but you should know how to do that already. So, login to your Interchange site admin interface.

Step 1: In that interface, you will see a tab called Miscellaneous. Click that tab, or look at the image below.

Interchange Tabs

Step 2: Click on the link on the lefthand side that says Layout Editor.

Interchange Tabs

Step 3: Click on the Category name that you want to change the order for.

The screen will now change and you will have a whole new slew of options to choose from. You will see a Select Area that has the title Contains.

Step 4: You should see your products for this category listed here. Click the category name and click the button that says either Sort Category Higher or Sort Category Lower depending on whether you want to move the product up or down in order.

Interchange Tabs

That’s it. To the point. There are a ton of other options in there, ones I haven’t even dealt with. But this is a simple task that seems pretty common.

How do I link stylesheets outside of the theme.cfg file and have them work in Interchange?

Posted Posted by jerothe in Interchange     Comments No comments
Aug
4

It’s been a long time since I posted, gosh, almost a year since I typed in this section. But now at work I am in the process of working on my second fully customizable interchange ecommerce website. I worked on one soon after I started, but that one fell through right near the end.

Let me back up, if you are already here, you probably know what interchange is, but it isn’t common knowledge, not as much as Smarty or Mambo. Interchange, in my limited understanding, is a flexible ecommerce open source code base written with a PERL base. The base setup or “store” as it is referred to has components that are customizable, and has in general a ton to work with, but is very confusing. I don’t tend to use the online admin interface too much, relying on my other development knowledge to allow me to work in Dreamweaver and Homesite primarily. Learn more at the interchange developers website.

Enough of that, what I am going to be discussing here today is simple, stylesheets in Interchange. In Interchange, all of the styles that make up the look of the “store” are located in the theme.cfg file. If you haven’t found this yet, you are really at a beginning level. Usually when I start a site, I have the base store, and in that store is this folder structure where your theme.cfg file should be located;

catalogs > shop1(Shop name) > templates > blueyellow (default store)

Catalogs is where you start, not public_html like traditional website data. In the public_html area there may actually be a link pointing back to the catalogs folder. Shop1 is the name I chose, but can be anything, you just have to pay attention. We have multiple shops set up for development before transfered to the primary server, all the way up to Shop5. Blueyellow is the default style the store is setup to appear online. You can change that in the admin interface, but that is a seperate entry in itself. You will see other styles in the templates folder, including purpleyellow and grayorange. All of the base “stores” look pretty much the same, except there are in a color scheme represented by the name, hence Blue – Yellow.

Within you chosen style folder (blueyellow) you should see a file called theme.cfg. Open this file in Homesite, Notepad, or some other text based editor and take a look at it. You will see something like this;

# This file defines the variables for templating.

ParseVariables Yes

# Theme images directory
Variable THEME blueyellow
Variable THEME_IMG_DIR __THEME__/
Variable THEME_LOGO __THEME_IMG_DIR__/logo.gif

ifdef LOGO
Variable THEME_LOGO __LOGO__
endif

##
## Set a default CSS theme which can be overriden in Preferences
##

ifndef THEME_CSS
Variable THEME_CSS >>EOV
>STYLE TYPE=”text/css”>

BODY { background-color: #FFFFFF;
font-family: Helvetica;
font-size: 12px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 0px;
}

TD { font-family: Helvetica;
And on and on….

Anyone with any basic HTML sense knows that the latter part of this is a stylesheet. This is what determines most of the look of the base Interchange store and can be edited to your liking. This is just a basic framework however, and if you are designing an Interchange site, I recommend pretty much starting from scratch unless your customer really doesn’t appreciate the benefits of an identity and branding.

Here is the kicker. In your browser you need to be logged into the admin interface as you are developing because everytime you change something in this sheet and ftp it to your server, the changes won’t take place until you click a link called “apply changes”. This basically recompiles the database and such with your changes and re-renders it out to the screen. This is one too many steps, and takes a ton of time. After a handful of sites, I said, there has got to be a better way to do this. I did find a different way that skips the “apply changes”, but structurally it isn’t the best.

I actually cut and removed all of the styles from the stylesheet and put them in a regular sheet with a .css extension. Then I made a styles directory in my images folder (in with templates, pages, and session among others) and published it to my server. I them made a regular link in my template regions to the sheet and published those. (Template regions is a whole other entry to write, but if you want to find your base templates, look in the “regions” folder once you are inside of the store base site like blueyellow)

This works! I was so happy. Publish and refresh the page and Interchange updates, no apply changes and wait for recompile. I do have a problem with the fact that it is not in a styles folder in the root of the site, but to save time this is more important.

Now, by doing it this way, it does become a stylesheet. You can parse through the sheet like you can when it is a theme.cfg file for any ITC variables through Interchange. That can be a downside I guess. I don’t really understand the point in how much time those variables really save, but maybe there are set more for consistency.

Today I actually explored putting the stylesheet in both the root, and in the pages directory, neither seem to work. I tried resetting the permissions on the directory and the file to match those set on images and their directories, but it didn’t seem to work. I assume that it is something I need to setup in one of the databases, but I am not sure. I am not a hardcore programmer, so most of that stuff is a little foreign to me.

The difference between flypage.html and results.html

Posted Posted by jerothe in Interchange     Comments No comments
Sep
28

I have been having a problem at work with the Interchange site I am building. The flypage, which is exactly what it is titled (A page that generates on the fly based on user input) was not applying the template. Every page of my site had the correct template except the flypage, and even then, it only seemed to be in a product category with all of the products listed respectively.

If you clicked on a specific product, the page came up with the correct template. Well, in the Pages folder there is a file called results.html. This is the page that is used solely to generate another page on the fly, this time only displaying the results of a user chosen category.

After I went in and set the correct template for that page everything seemed to work fine. And easy mistake to make, my boss actually pointed this out to me since this is the first site I have built that has steered away significantly from the base template.

How to write Interchange comments

Posted Posted by jerothe in Interchange     Comments No comments
Sep
24

This should have been obvious to me, but wasn’t until this point. Today I picked up that in order to comment something out in ITL (Interchange Tag Language) you need to surround the comment in [comment] tags.

For example;
[comment] This is a comment. [/comment]

HTML comments do not work in Interchange

Posted Posted by jerothe in Interchange     Comments No comments
Sep
23

You know now how to trouble shoot having incorrect line breaks in the theme file, which is part of the base which around Interchange works. But you still need to learn about the nuances of troubleshooting problems in Interchange.

Interchange’s parsing engine will parse through every bit of code, including HTML, ignoring it if it doesn’t understand.

However, this means that if you comment out a piece of Interchange ITL code with HTML comments, it will still parse it. So, make sure that if you are testing, and you want to not permanently remove something, just delete it really quick, publish it and check the changes. Then do a redo if it doesn’t work. This seems strange at the moment, but as of now I do not claim to be an Interchange expert and I may find out how to truly comment out Interchange code.

I think that Interchange comments are used with a # sign, but I will have to write back about that.

Where are the product pages for an Interchange located?

Posted Posted by jerothe in Interchange     Comments No comments
Sep
22

All product pages are created on the fly using the “flypage.html”. This file is located in the pages directory with all of the other .html files.

What does [area example] mean when setting up global links in the navigation?

[area example] is the format for setting up the links throughout your site. Usually defined in the _TOPLEFT_ template, “area” will look in the pages directory for the name of the file listed, minus the .html.

In this example, it will look for a page called example.html.

My theme.cfg is not updating on my Interchange site.

This has been the bane of my existence since I started working on my first Interchange website.

I have already mentioned one way previously about changing the line break types in Dreamweaver, and here are some other methods to prevent any non Unix breaks from getting in that file.

Make sure that you .cfg files are being uploaded in ASCII and not the default ftp of Dreamweaver which is Binary. In order to set this you need to edit the FTP Extension Map file.

On your local hard drive, navigate to the directory where your Dreamweaver is installed.

Macromedia > Dreamweaver MX 2004 > Configuration > FTPExtensionMap.txt.

Open this file in Notepad and you will see different file types listed and the type of ftp method for each. Add your extension in a similar format and specify the type of ftp method you want. As a rule of thumb, most web files are ASCII except for Image and Media files which are Binary.

Save and Exit the file and restart Dreamweaver for those changes to take effect.

The second way you can make sure to rid your file of CR Windows breaks is to make sure you are saving the correct type of file in Homesite (If you are using it).

Open Homesite

Options > File Settings

In this section you should see three different types of method to save the files, PC, Unix and Macintosh. Set the type to Unix.

What happens if I get the file on the server and it isn’t working, can I get rid of the CR breaks?

Open up SSH and navigate to the folder where your theme.cfg file is located.

At the prompt type this command. (It’s an Octal Dump with a Grep to find any CR line breaks in the code.)

od -a catalog.cfg | grep cr

Hopefully, this won’t spit anything out, but if it does, then you should be able to clean up the file. Either save it again with the changes made in Homesite and upload it again. Or, you can run this command at the prompt line.

perl -pi -e ‘s/\r\n/\n/g’ < old_file.cfg > new_file.cfg

These are three great ways to fix your theme.cfg file for your interchange site.

Working with Interchange config files between Homesite and Dreamweaver.

Posted Posted by jerothe in Interchange     Comments No comments
Sep
21

It has been a long couple of days. The first interchange site I built, I modified the config file and the graphic, a little bit of the base design, and that was all. It was challenging for the first time, but I could go back and do it without batting an eye now.

However, I have now been thrown right into the flurry, trying to build a complex interchange ecommerce site, that I designed, as the first project I did at Esystems. I am finding out all sorts of little nuances.

Here is a little tip. I am working with Homesite, Dreamweaver, and the Interchange mess of an interface to develop the site. Your config file is essentially your style sheet for the site on steroids. It has some variable declarations and other things.

If you start are going to try to edit files in Dreamweaver, the only ones you will be able to are the .html files. You will not be able to edit any of the components, template files, or config files without using Notepad, or by using my preferred program, a scaled down Dreamweaver known as Homesite.

But even if you write some code, and then past it into Homesite, for those mentioned files above, they will mess up interchange and won’t work, in the most basic sense. This is mainly because the “breaks” in characters are read differently from a Linux(the server for your Interchange site most likely) and Windows. But you can fix this.

In order to change the type of character breaks, go into Dreamweaver and choose the Edit menu.

From the Edit menu > Preferences.

Code Format > Line Break Type

Change this from CR LF(Windows) to LF(Unix). Save this and close out your preferences.

This will solve some of the problems you may have when you apply a change in Interchange, and it reads from it’s cached tmp file instead, because you have corrupted the file with incorrect line breaks.

"Constant" – It's a Local Variable. What's That?

Posted Posted by jerothe in Interchange     Comments No comments
Sep
16

I feel compelled to write something today on Interchange, since I have working with it on a very regular basis.

As I was looking through one of the “include” pages in my site files, I was trying to figure out what everything means.

__CONSTANT__

This was what I was trying to figure out, what is this.

Basically, this is a local variable.

When in the administration interface, click on “tables”. In tables, at the bottom you will find a category called “variables”. In this section is where you set variables such as __CONSTANT__. In this case, __CONSTANT__ is set to a string value of “Red”. This is then used in multiple spots throughout the site.

What the advantage is, I am not sure. I would assume it would make for a very quick change for something very simple. But doesn’t seem like much of an advanced option in terms of design, because making a font color change, by spelling out the color is so uncommon, not to mention, not a light decision, that it doesn’t seem to fit into my design arsenal.

Introduction to understanding Interchange, Open Source Ecommerce solution

Posted Posted by jerothe in Interchange     Comments No comments
Sep
4

I built my very first, very basic website with interchange this week. I hope to add things as possible, so that the basic user for this open source E-commerce solution might have some help where it may be lost on similar forums that cover more advanced topics.

In the main interface, under the “content” tab, you will be set by default to the catalog > pages section. You are not able to move from this directory unless you go to the transfer files tab which is also under content. If you click on the page that you want to view, you will come to a screen that will show the different sections of the page, and the different components that are pulled in to create that page on the lower left. If you click on each section tab, you can find out which component you need to edit to update the look you are creating for the client.

Unfortunately, which is why it is open source because you can change the interface as need be, you need to move 3-4 clicks out of the area to the components section to edit them individually. Each component file when ftp downloaded from the site will have a different file name then the variable that is assigned each component in the component section. So take note when you click, content, “component edit” what the name is so that you can click the link to edit the file.