Results 1 to 10 of 19

Hybrid View

  1. #1
    Join Date
    Nov 2010
    Posts
    9
    Plugin Contributions
    0

    Default Help a newbie install a piece of javascript with product vars on a product page

    Hi all,

    I'm trying to install a piece of javascript on a client's ZC store. We don't do webdev, we're a 3rd party working with them to get this installed so I don't have any experience designing/customizing Zencart stores.

    This js needs to go in a specific area of the product page and needs to be installed on every product page. I'm guessing I enter this in the template product_info_display.php file? They're using theme360 if that helps. I don't know PHP very well so I'm not sure exactly where to place this.

    Additionally, the js needs to have product page variables/template tags inserted into it. These vars include: brand/manufacturer, part number, price, title. Where can I find these template tags/vars? Is there a wiki or some documentation with a list somewhere?

    I appreciate any and all help! I'm digging around in a lot of these php files but am really unsure where everything goes. Placement of this script is key and I dont want to break anything.

    Thanks!

    jhkaplan

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    It sounds like a lot of what you want to appear can be handled by standard functionality, switched on or off in various places in the admin panel.

    These will not be "template" issues, because the stuff you want to appear is MOSTLY resident in the database.

    But you are trying to build a Cessna out of a 747...

    Just configure the admin switches and you will have all the data you need.

    Additionally, "Theme360" sounds like a template monster template, and these are HUGELY PROBLEMATIC in their own right. As they are highly customised, you may struggle to get help on this forum. They can wreck core behaviour.
    19 years a Zencart User

  3. #3
    Join Date
    Nov 2010
    Posts
    9
    Plugin Contributions
    0

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    Quote Originally Posted by schoolboy View Post
    It sounds like a lot of what you want to appear can be handled by standard functionality, switched on or off in various places in the admin panel.

    These will not be "template" issues, because the stuff you want to appear is MOSTLY resident in the database.

    But you are trying to build a Cessna out of a 747...

    Just configure the admin switches and you will have all the data you need.

    Additionally, "Theme360" sounds like a template monster template, and these are HUGELY PROBLEMATIC in their own right. As they are highly customised, you may struggle to get help on this forum. They can wreck core behaviour.
    Thanks. Again, I'm pretty new to ZenCart, so I dont understand what you mean by 'switched on or off in various places in the admin panel.'. I need to insert the JS on product pages and update the JS with product vars so we can dynamically display an image based on a True/False statement from what the vars pass back to us.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    Are these product variables going to change dynamically for a single product? If so, how and why would they change? If they do not change while the user is viewing the product, there is no need for javascript.
    We really need more specific info before we can give accurate advice.

  5. #5
    Join Date
    Nov 2010
    Posts
    9
    Plugin Contributions
    0

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    Quote Originally Posted by gjh42 View Post
    Are these product variables going to change dynamically for a single product? If so, how and why would they change? If they do not change while the user is viewing the product, there is no need for javascript.
    We really need more specific info before we can give accurate advice.
    No, we're just using the js var collection to collect the product fields (ie brand, part number). Forget I said the word dynamic; something else about what the script displays is dynamic, but it's based off of the collection of the brand and part number variables. IE if brand=sony then display this image, if brand=panasonic then display this image. We're just using the collection of the brand and MPN as pieces of an equation, calculated on our end, to dynamically display an image on the product page.

    The piece of the script I'm working on looks like this:

    // * Product Page Fields //
    'Brand' : 'XXXXX',
    'MPN' : 'XXXXX',

    The XXXX would be replaced by the CMS vars. In other systems I've worked with, it's something like [brand] or [manufacturer_sku]. I'm new to the Zencart world and am trying to figure out what these variables are. I'll have to work with ZC multiple times this year (as well as 10,000 other CMS's for the same type of implementation), so I'm trying to collect as much knowledge as I can to get the implementation figured out.

    Thanks for your help!

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    Quote Originally Posted by jhkaplan View Post
    Thanks. Again, I'm pretty new to ZenCart, so I dont understand what you mean by 'switched on or off in various places in the admin panel.'.
    This is an EXTREMELY GOOD REASON why you should not be fooling about with the core code. It is like a bus driver attempting heart surgery.

    Before you look at very complex issues such as dynamic rendering, using JS, and possibly custom coded calls to the database, start by learning how zencart works on a user level.

    It would appear that you have scant knowledge of CMS systems, because you don't seem to know that ZC operates off a database (your focus is on using JS to collect info from FILES).

    I am not criticising you for your lack of knowledge, but the person you are trying to help would not be very impressed if they were in lying a hospital operating theatre, and a bus driver was wielding the scalpel.
    19 years a Zencart User

  7. #7
    Join Date
    Nov 2010
    Posts
    9
    Plugin Contributions
    0

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    Quote Originally Posted by schoolboy View Post
    This is an EXTREMELY GOOD REASON why you should not be fooling about with the core code. It is like a bus driver attempting heart surgery.

    Before you look at very complex issues such as dynamic rendering, using JS, and possibly custom coded calls to the database, start by learning how zencart works on a user level.

    It would appear that you have scant knowledge of CMS systems, because you don't seem to know that ZC operates off a database (your focus is on using JS to collect info from FILES).

    I am not criticising you for your lack of knowledge, but the person you are trying to help would not be very impressed if they were in lying a hospital operating theatre, and a bus driver was wielding the scalpel.
    Maybe I'm not explaining it correctly, but most of what you said above is wrong. But if you're not here to help, please move on. I'm looking for constructive help, not to be told I dont belong.

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    Then please explain your needs in more detail so we can actually help you.
    OK, you just did:)

  9. #9
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Help a newbie install a piece of javascript with product vars on a product page

    Quote Originally Posted by jhkaplan View Post
    Maybe I'm not explaining it correctly, but most of what you said above is wrong. But if you're not here to help, please move on. I'm looking for constructive help, not to be told I dont belong.
    Everybody is welcome here, and I don't recall saying "you don't belong".

    You said: "I'm pretty new to ZenCart, so I dont understand what you mean by 'switched on or off in various places in the admin panel."

    ... which to me is quite a direct admission that you do not know what you are doing (with Zencart).

    My comments are frank, I admit, and I do not wish to offend, but if you have not even botherd to examine the user functions available to you, through an interface that a complete non-tecchie could understand, then one must assume you don't know how this system works.

    So I do apologise if you took offence... but I still recommend you take some time to at least learn the basics of the admin area. To me that is fundamental of you intend to inflict (probably unneccessary) changes on the code.
    19 years a Zencart User

 

 

Similar Threads

  1. v151 Problem with ceon and add a javascript in product page...
    By onlysteg in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 31 Jan 2013, 10:32 PM
  2. Help? product table on category page: 1 product per row with 7 columns giving specs
    By wbmangy in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 16 Feb 2009, 12:17 PM
  3. Please help a zc newbie with install!!
    By laurazee in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 31 Jan 2009, 06:51 PM
  4. Newbie needs help with changing product and page links
    By BrodieGirl in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 10 Nov 2006, 06:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR