Build Your Own Business Website header image

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

Lesson 5 – Part 4 – Examples of Changing Shopp with Template Tag Options

Difficulty Level -

Listed Under Lesson Subjects - ,

Applies to -

I’m going to show you one example of this. I warned you about this last week. Let’s take a look at it here. Actually, I’m going to make a different connection quickly. We’re going to go thesisshopp.com and we’re not going to make this change on Lanny’s site because it’s not really applicable in his situation.

But you remember that when I created this product of dress shoe, I gave it a men’s and women’s option and the women’s option has brown, black, and red but the men’s option really only has brown and black. If I pick red, I couldn’t pick small, medium or large because they’re not available and because we have disabled them in the product creation. If I pick brown then I can pick small, medium or large. So you can have these various options or variations in Shopp. Some of which are applicable to one variation, some of which are applicable to others.

How to Use the Template Tag

It would be great though when you’re on red because it doesn’t show these, right? Actually, it would really be great if it didn’t show red as well but you’re going to see that’s actually not possible. You have 3 levels of variation like this and it’s only the last one that really gets hidden. Nevertheless, I’m going to show you how to use that template tag in order to make that go away. The Shopp template tag that we use is product and the property has variations.

If we take a look at this in product PHP and we look for our variations, here’s our Shopp that has variations then this is the place where we are going to set an option that hides those disabled options.

Before I do that though, I want to switch back and forth here for a second. Okay, so we’re looking at product and we’re looking at our variations options. You have 3 options of variations options. It has variations, variations, and variation so it’s easy to get it mixed up just like I got it mixed up. Variations is the one that we’re going to use and there are several options under variations but the option that we’re going to use is disabled. By default, disabled is shown but what we’re going to do is to switch disabled to hide.

Separating Options with Ampersand

If we come back over here and we look at product variations, I’m just going to go to the end here. Inside that single quotes, we’re going to put an ampersand because that’s how we separate each option; ampersand and it’s going to be disabled = hide. So you just insert an option in this template tag that’s going to cause that behavior. We save it, upload it and we come back over and refresh the view.

Now, if we pick men’s, we can still pick red but unfortunately there is no option that shows up below that. There’s no way to add this to the cart and you have to select the options for that. You’re not going to see any options until you switch to brown and now, you have an option.

You may remember that it’s the same thing with women’s shoes and running shoes. In running shoes, if we pick women’s option, there was no black option in women’s. If we pick black, if we pick small and add to cart, we’re going to get a failure here. I remember editing this product but evidently, I did not. Let’s just go do that real quickly. Let’s go over to Shopp, products and running shoes and let’s disable women’s black running shoes.

So men’s brown, men’s black, women’s black. Maybe what I did was I just disabled one of them. Oh no, it was women’s brown that I disabled, I missed that. Women’s brown is disabled even though I created a women’s brown image. You see, it doesn’t show up here.

Modification of the Template Tag

Actually, there was one other thing I wanted to show you about that and that is the same thing that happens with items that are out of stock. I deliberately created one of these items with no stock. Let’s see products and you’ll see that you can’t choose that. I believe it was in the women’s running shoes but there’s no inventory associated with women’s shoes so it must be a different product.

Okay, women’s brown small, 0 in stock. Women’s brown small dress shoes, that’s what it was. If we go back over to shoes and dress shoes and women’s brown, there’s no small. There’s only medium and large. That’s how that modification of the Shopp template tag works.

Let’s look at another example that is related to the variations. It’s not that great an idea when you’ve got 3 variations like this but maybe, what you want to do is provide all of those variations in one fell swoop or in only one drop down.

Using Mode to Provide Variations in One Drop Down

The way you do that is with mode. Under variations, with mode, the default is multiple. If you make it single, what will happen is all of those choices will be drawn together into a single drop down list and you only have to make the choice from the one list. What we’re going to do next is make mode = single and again, we do that here in variations. You can see that it came automatically with mode = multiple so we’re going to say mode = single then we’re going to save that document and upload it and then refresh.

Now it says select an option. Those options that are out of stock are not selectable. Those options that are not possible like men’s red dress shoe don’t even show up, right? Only the women’s red dress shoe shows up. The ones that are out of stock show up but you can’t select them. That’s another customization that you can use for this.

Setting the Taxes

Then the 3rd example I want to give is applicable in Europe and this is something somebody has been asking me about today. That is the value-added tax or VAT. He’s probably French or something but I’m not quite sure what that would be but nevertheless, the VAT in Europe has to be included in the price. When you display a price here, the price cannot show before tax.

Since everybody, everywhere in Europe pays the same VAT tax which is 19 half percent, if you can believe it, this price can’t show $9. It’s got to show the $9 plus VAT and that’s the next thing we’re going to do here.

If we come back over to our settings for a moment and we look at our taxes, I have set the taxes to be 8.75% in all markets. I can’t bring myself to say 19.6% which is what the European VAT is. This is Washington state sales tax but I’m making it in all markets rather than just being related to Washington.

Using the Template Tag Price to Indicate Taxes

What we do though is we use the template tag price. If we come back over here and look at our product, this template tag, product price, this is where we will indicate that the taxes are part of this. For example, this doesn’t have any options right now. What you would do is to put a comma in there and then opening and closing single quotes and then taxes = true. Sometimes these things are true and false and sometimes they are descriptive but nevertheless, in this case, it’s taxes = true.

I’ve just done that in the section called the original price which only shows up if Shopp products are on sale and where this is really going to show up in our situation is where products are not on sale. Put that comma in there so this is the PHP Shopp product price, taxes = true. If you just want to check the documentation, I want you to get used to using this documentation because that’s exactly what I had to do constantly.

If we come back up here to product, look for price and then we look at our options, it says taxes. When set to true, the taxes will be included and so, we set that to true. We’ve uploaded it and now we’re going to go ahead and take a look at what happens with taxes being included. Now the price has the tax included.

Oddly enough, the price here does not reflect tax and I know that there is a way to remove the price from this as well but it involves a little bit of jQuery. If somebody needs help doing that, I’ll be glad to do it separately but it’s a little bit more complicated. This is perfect on stuff like single product items where there’s not an option with variable prices..

For example here, notice how the price is not different. If we click on the Inner Game of Tennis, you’ll see its price is $21.70 but if we go back to the categories, it’s not. It’s only $19.95. The reason this is the case is because I didn’t change this template, I only changed the product template. If I want to change this price here, I have to change the category template. That’s what we’re going to do next.

We come back over here to category and where the category shows up is product. Where is the price? I’m missing it here. Product name, product, sale price starting from, product savings, this is it here. If product has savings, we’re going to end up putting it in a couple of places here because you’ve got the same issue with sale price as with savings.

What we’re going to do here is show = percent, we’ll put a comma and then taxes = true. Let’ see, I come on the wrong spot. What that needs to be is the ampersand. Okay, show = percent, ampersand taxes = true. Actually, maybe we should do that same thing, we’ll copy that. Now we hit save.

I’m looking for category. Upload that one. Now if I refresh this, it shows the changed price. Probably, if we go to shoes, it’s going to show the changed price too, right? From $9.79,  I take VAT or any other tax to be included in the total price. I really don’t think we have to deal with it in the US but it certainly is an issue in Europe so that’s how you deal with that.

And that concludes our lesson on how to use template tag options to change Shopp.

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
THIS IS A LIMITED TIME OFFER!
Subscription Options
0 Comments… add one
0 comments… add one

Leave a Comment