Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi!

 

I wonder if there is some contribution that can refresh the content on the page without having to refresh the whole page. For example if I click on a new category in the categorybox it will only refresh the the part of the page that contains the productlist and not other parts of the page. I have searched but not found that.

Link to comment
Share on other sites

Hi!

 

I wonder if there is some contribution that can refresh the content on the page without having to refresh the whole page. For example if I click on a new category in the categorybox it will only refresh the the part of the page that contains the productlist and not other parts of the page. I have searched but not found that.

 

Jol,

 

Most STS users read (and reply) to both STS supprot threads, this one (for STSv3 and older) and the other one (for STSv4 and newer). Please do not double post. I responded to your request in the STSv4 thread.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Dear Frends!

 

 

It's possible to make Templates for "NEW PRODUCTS" and PRODUCT LISTING"?

 

Thanks for great Contrib and best regards!

Luckyduke

 

If you are wanting to template the box, you would create an infobox template for them:

 

infobox_product_listing.php.html

infobox_new_products.php.html

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Heya Bill,

 

I posted this to your PM but am posting here also just in case anyone else in here can add their 2 cents also.

 

==============

 

This is a question regarding the ADD NEW PAGES contrib for this addon. I have used and modified it a bit to fit my website and have gotten a lot of good feedback on it nationally. I do have a question with the contribution you shared about adding new pages though.

 

I guess I'm somewhat of a php newbie so as of now, I have a lot of pages to add using your posted method. HOWEVER, what I'm trying to do is create subpages within my pages so that I do not have to edit all of the files that you specified...everytime I want to create a new page.

 

For instance:

 

www.iloveono.com/about.php is a page created using the "add new pages" contribution method. I want to add subsections, like "biographies, timelines, company history...etc" while still just using the about.php as a main template....vs creating a new page for every subpage I offer....it just cuts down on time for me as I want to create many pages.

 

Does that make sense? and is it possible? I am assuming yes, but my lack of php knowledge is constricting me now. Thanks a lot and I look forward to hearing your response.

 

Viet

Vetty

Chief Creative Officer

ONO Tea |

Link to comment
Share on other sites

If you are wanting to template the box, you would create an infobox template for them:

 

infobox_product_listing.php.html

infobox_new_products.php.html

Morning folks! I found out about this STS script when I was Googling some keywords trying to find a site that talked about OSC themeing. Gotta say this script made that a lot more simple and got the basic layout up and going pretty fast. Kudos to the developer of this script.

 

Now what I was looking for was for some kind of ref, or doc which pretty much explains exactly what the above poster just laid out. I'd like to know what filenames I need to make to add the custom styles to the parts of the OSC system. I'm working on a clients site using the OSC and just wanted to make sure all the paths were covered. Here's the site I'm working on using the STS module: http://www.shopgripit.com/catalog/

 

Thanks for the time!

lates!

Link to comment
Share on other sites

Hello,

 

I have problems with $addtocartbutton$ Variable.

 

if I copy and paste the variable, then the Button is visible, but Link doesn't work.

 

Please Help!

Did you remember to use the startform and endform tags?

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Did you remember to use the startform and endform tags?

 

Hallo Bill,

 

thanks for reply.

 

I use the original product_info.php.html Template.

 

About startform and endform Tags I don't no.

 

But when I duplicate the variable from template, the original work further good, but the copied not work.

The Code is same.

Link to comment
Share on other sites

Hallo Bill,

 

thanks for reply.

 

I use the original product_info.php.html Template.

 

About startform and endform Tags I don't no.

 

But when I duplicate the variable from template, the original work further good, but the copied not work.

The Code is same.

 

Dear Bill,

 

you have right, sorry!

 

I forget the starform & endform Tags on right place.

 

But I have other problems...

 

1.) $reviewsbutton$ don't work.

 

2.) $regularprice$ / $specialprice$...

--> If I use only $regularprice$ , then Specialsprice is not visible.

 

--> If I use only $specialprice$ , then "old Price" is not visible.

 

--> If I use both, then both is visible, but like that (e.g.):

 

47.59EUR

5.12EUR

 

old Price is without crossed.

 

3.) How can I do visible SPPC/QPB contrib?

Price breaks is not visible!?

 

[sorry for my BAD english]

 

Regards

LuckyDuke

Link to comment
Share on other sites

Bill, and others,

I would like to verify if i'm doing the right thing here regarding sts, so here goes:

 

I would like to present the center-'contents' of every page in my shop in a sts design so i can easily change (upgrade) to a new design if i like to. Just to explain a bit more, php pages that generate the center contents are for example: index.php, shoppingcart.php, account.php, etc... basically most of the php scripts that reside in /catalog.

 

My approach is to use the infobox (heading/contents) pattern and create a sts-box script for each one (which is basically the same currently; it only has the $headertext and $content tags in) as described in the manual (so for example the one for account.php becomes catalog_account.php.html).

 

Now the tricky part is to have the headertext seperated from the content and i do this now by refactoring each of the original scripts to put all the html output if the infobox-heading/content classes (because this fills the tags that i need automatically).

 

Although this feels really good (seperating the business logic from the presentation) it also gives quite some work (about 50 scripts to go...).

 

My question: is this the right way to do this?

 

Thanks in advance,

Paul

Link to comment
Share on other sites

Dear Bill,

 

you have right, sorry!

 

I forget the starform & endform Tags on right place.

 

But I have other problems...

 

1.) $reviewsbutton$ don't work.

 

2.) $regularprice$ / $specialprice$...

--> If I use only $regularprice$ , then Specialsprice is not visible.

 

--> If I use only $specialprice$ , then "old Price" is not visible.

 

--> If I use both, then both is visible, but like that (e.g.):

 

47.59EUR

5.12EUR

 

old Price is without crossed.

 

3.) How can I do visible SPPC/QPB contrib?

Price breaks is not visible!?

 

[sorry for my BAD english]

 

Regards

LuckyDuke

Those variables depend upon your store's configuration regarding the use of special prices as well as your stylesheet.css file and how it displays the regular price versus the special price. STS is bound by your shop's configurations as stated above.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Bill, and others,

I would like to verify if i'm doing the right thing here regarding sts, so here goes:

 

I would like to present the center-'contents' of every page in my shop in a sts design so i can easily change (upgrade) to a new design if i like to. Just to explain a bit more, php pages that generate the center contents are for example: index.php, shoppingcart.php, account.php, etc... basically most of the php scripts that reside in /catalog.

 

My approach is to use the infobox (heading/contents) pattern and create a sts-box script for each one (which is basically the same currently; it only has the $headertext and $content tags in) as described in the manual (so for example the one for account.php becomes catalog_account.php.html).

 

Now the tricky part is to have the headertext seperated from the content and i do this now by refactoring each of the original scripts to put all the html output if the infobox-heading/content classes (because this fills the tags that i need automatically).

 

Although this feels really good (seperating the business logic from the presentation) it also gives quite some work (about 50 scripts to go...).

 

My question: is this the right way to do this?

 

Thanks in advance,

Paul

 

Paul,

 

Be sure you understand the basic template naming syntax first before going to all of that trouble as STS may already do what you are trying to accomplish:

 

TIP

Here is a quick rundown of common template names:

 

  • sts_template.html
    • = Default template

    [*]index.php.html

    • = Default Category template (used for all category pages that do not have a specific template page created for it – if you didn’t have this template, STS would use sts_template.html).

    [*]index.php_0.html

    • = Home page template

    [*]index.php_x.html

    • = Specific category template where x = the category ID.

    [*]index.php_x_y.html

    • = Specific subcategory template where x = the category ID and y = the subcategory ID

    [*]product_info.php.html

    • = Default Product template (used for all products, in all categories, if no specific product template is found).

    [*]product_info.php_c23.html

    • = Product template for all products in a specific category (23 in this example – change to the category ID needed)

    [*]product_info.php_23.html

    • = CONTENT template for product ID 23. All content template should be saved in the SGP/content/ folder. Review the sample content template provided in the STS template “full/content” folder. The STS Module Product Info must be enabled in order to use this STS feature. This template is not recommended unless you really know what you are doing since you would need to make modifications to it if you ever added new osCommerce contributions to your shop.

    [*]popup_image.php.html

    • = Template for the product popup image.

    [*]index.php.mfr.html

    • = Default Manufacturer template page (used for all manufacturer pages that do not have a specific template page created for it - if you didn’t have this template, STS would use sts_template.html).

    [*]index.php.mfr_x.html

    • = Specific Manufacturer template where x = the manufacturer ID.

    [*]stock osCommerce PHP scripts:

    • create_account.php.html
      • = Specific template for the create_account.php script

      [*]account.php.html

      • = Specific template for the account.php script

      [*]checkout_payment.php.html

      • = Specific template for the checkout_payment.php script

      [*]etc., etc., etc., and so on for each of the pages in your catalog

So, using the correct naming syntax shown above, you would not create a page template in the same manner as you would an infobox template.

 

If you are only trying to separate the design of the Page Title (I think this is what you mean be mentioning the $headertext) than you would need to modify the following code in your index.php (if you want a specific design for a particular page such as account.php, then you would need to modify the same code in those pages as well):

 

			<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

The above code controls the header text of each page in your shop. You can assign a separate CSS class to specific pages if you wanted to get a special effect for that particular page or simply modify your stylesheet.css file for the pageHeading class and it will display on each of your pages in your shop. This class is already separate from the main content of your shop.

 

Here is a link regarding infobox templates:

http://www.oscommerce.com/forums/index.php?sho...p;#entry1227006

 

Here is a link regarding the above template structure in more detail:

http://www.oscommerce.com/forums/index.php?sho...p;#entry1226986

 

Hope you found this helpful,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Paul,

 

Be sure you understand the basic template naming syntax first before going to all of that trouble as STS may already do what you are trying to accomplish:

 

TIP

Here is a quick rundown of common template names:

 

<...>

 

Hope you found this helpful,

 

Bill,

Thanks for the response. I would like to have the title in a seperate tag (seperated from the rest of the content) and regarding the design of the template, i want to draw a large rectangle (curved) around the $content and display the title centered on the top line of the rectangle.

What i'm doing now is indeed quite some work but the advantage is that i really learn what the pages contain! (Although i prefer a solution by STS keeping the catalog files original...) ;)

Paul

Link to comment
Share on other sites

Bill,

Thanks for the response. I would like to have the title in a seperate tag (seperated from the rest of the content) and regarding the design of the template, i want to draw a large rectangle (curved) around the $content and display the title centered on the top line of the rectangle.

What i'm doing now is indeed quite some work but the advantage is that i really learn what the pages contain! (Although i prefer a solution by STS keeping the catalog files original...) ;)

Paul

 

Paul,

 

Here you go:

 

Add the following new tag in your includes/modules/sts_inc/general.php file:

 

 $sts->template['headingtitle'] = HEADING_TITLE; //Added for pageHeading replacement.

 

Now, go to your index.php file and comment out the following line:

			<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

It should look like this:

			<td class="pageHeading"><?php //echo HEADING_TITLE; ?></td>

 

Now, simply add the following line in your template replacing the formatting anyway that you wish:

 

<td class="pageHeading">$headingtitle</td>

 

This new tag ($headingtitle) will produce the title of the page being displayed. By commenting out the code above, you will not display the title in the "content" of the page.

 

Hope this helped,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

First of all, I want to say THANK YOU to everyone who has contributed to the development of STS. I don't know how we ever produced OSC stores before we discovered it.

 

I have run into a small problem with our latest project, however.

 

We're trying to integrate More Pics 6 (http://www.oscommerce.com/community/contributions,1611) with our product_info page. Unfortunately, our product_info page has a unique layout, and we've had to use /content/product_info.php.html to lay it out.

 

The More Pics 6 contribution has some instructions on integrating in to STS 4.2, using content templates, so hopefully it's just a small code change to get it working with the latest version. As it is, if I install the More Pics contrib, and use its two variables inside our product info template ($product_popup$ and $mopics_output$), we get no images at all. If I disable the content template (Instead simply using sts_template), the more images show up perfectly, but the product page has the standard layout.

 

So - Has anyone gotten More Pics 6 working with the latest STS, and if so, can you please inform me of how you did it? If nothing else, I'm just going to use the standard layout (IE, no content template) and just update product_info.php with the new layout...Not how I WANT to go about it, but if it works....

 

Thanks in advance.

Link to comment
Share on other sites

I am trying to create a content template for the product info page. My file is template/content/product_info.php.html. I am trying to add the "Also purchased" box to the page using this code:

 

<p>$alsopurchased$</p>

 

But this doesn't show up on my page. My store is not "live" yet, but my client has made a few purchases. I can't though see this on the page. I tried logging in as well, but still don't see it. How can I get this on my page?

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...