Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dynamic stylesheet changer contribution


newid

Recommended Posts

Hi,

 

I'm working on a contrib that will allow dynamic changing of the stylesheet. I've got it working for the most part. It's a very simple thing, but I wonder if someone can help me on one issue.

 

On the product information page for any given product, you have the "products webpage" link. What I would like to do is make it so that this link is a direct link with no "http://" in front of it, and I'd also like to take the popup out. I can see how the popup is taken out in product_info by simply taking away the target tag, but how to I make it so that I can enter a javascript link for the product webpage link in the admin section and have it NOT place the http:// in front of it?

 

Thanks

Beau

Link to comment
Share on other sites

Hi,

 

In looking over product_info.php, I find the following line.

<?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info_values['products_url']), 'NONSSL', true, false)); ?>

 

Looks like this is where the link to the products webpage is being created. I can remove the 'action=url&goto=' bit and I can remove the 'urlencode' and the nonssl stuff from the link, but the "http://path/tocatalog" still remains in place.

 

Just so you know, I AM wanting to change this link across the board. In other words, I know that once this is changed, it will be changed for every product added from here on out and that would make it impossible to actually link to an external page using this feature. What I'm doing is, creating a site using osc that will allow folks to come and submit stylesheets for osc. I'll add the stylesheets as downloadable products via the admin section (with a screenshot as the product image) and when the visitor views a particular product, the link to the products webpage will say "to see this stylesheet in action, click here". I've already changed the actual text in the languages product_info file. Anyway, when they click on the link, the stylesheet will dynamically be activated on the page they are currently looking at.

 

Only problem is, the link that is created currently is a link that begins with "http://pathto/catalog". The link that needs to be there will not have that stuff in place. The link will simply be the product link. For example, let's say that I add a product (a stylesheet) and for the product link I enter "java script:changeSheets(1)". When the visitor is looking at the product info page for that product, the link to the products webpage would be created using ONLY the javascript link above, without the "http://path" in place.

 

Can anyone rewrite that line above to show me what it needs to look like? I think this would be a great site to have in so far as a stylesheet resource site goes for osc. If I could just figure this part out, I'd be all set to launch it.

 

Thanks

Beau

Link to comment
Share on other sites

I found it! I changed the line to the following:

 

"<?php echo sprintf(TEXT_MORE_INFORMATION, ($product_info_values['products_url']), 'NONSSL', true, false); ?>"

 

and now it works just like I want it to. I love when something works! I swear, if I had the time, I'd go back to school and start learning programming! I know you guys gotta love what you do.

 

Thanks

Beau

Link to comment
Share on other sites

  • 1 month later...
Hi,

 

I'm working on a contrib that will allow dynamic changing of the stylesheet.  I've got it working for the most part.  It's a very simple thing, but I wonder if someone can help me on one issue.

 

 

Has this contribution come to light?

 

I can't find it in contribution files...

 

Thanks

 

Salvo

Link to comment
Share on other sites

If this isnt around yet, get the Thema contribution that was released on Saturday.

 

This already does that as part of a 5 theme mod.

 

I have put it on and it works spot on.

 

Now we can start introducing new themes...

 

CC.

 

P.S. There is also the possibilty to blend in *nuke themes if you have the time.

I am working on this now.

Link to comment
Share on other sites

I gave up on it. Too many other things in the bucket and with Christmas just around the corner, I have to get myself ready to make some money from the rush. I figured that since they were going to be creating a template system for osc, this contrib would only be valid until they released the template system. I did have it working, but the one thing that kept me from contributing it was the fact that when you changed the stylesheet, the change only took place on THAT page. As soon as you went to another page on the site, it went back to the default stylesheet. This other contribution looks like it would be much better. Now if I could only learn to read it!

 

Beau

Link to comment
Share on other sites

  • 2 years later...
I found it!  I changed the line to the following:

"<?php echo sprintf(TEXT_MORE_INFORMATION, ($product_info_values['products_url']), 'NONSSL', true, false); ?>"

and now it works just like I want it to.  I love when something works!  I swear, if I had the time, I'd go back to school and start learning programming!  I know you guys gotta love what you do.

Thanks

Beau

 

thanks alot i needed this one!

 

Edit: whoa i just found out rnow how old this thread was

Edited by technoboy
Link to comment
Share on other sites

  • 2 years later...

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