Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Nov 2004
    Posts
    80
    Plugin Contributions
    0

    Default Basic php question

    Sorry for all the questions today but I've been awake for far too long and my searching skills are deteriorating quickly. I want to put the model number under the product name in the product listing page (in the same column). It's almost there, but instead of "model" I'm getting "TEXT_PRODUCT_MODEL." It's looking for the define in english.php but it's really in /includes/languages/english/template/product_info.php. How do I get it to look for it in the right file? Here's what I have so far:

    Code:
    $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . '<br>' . TEXT_PRODUCT_MODEL . ': ' . $listing->fields['products_model'] . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
    Also, anyone know how I can make the gap between product name and model number smaller?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Basic php question

    Quote Originally Posted by besheer
    Sorry for all the questions today but I've been awake for far too long and my searching skills are deteriorating quickly. I want to put the model number under the product name in the product listing page (in the same column). It's almost there, but instead of "model" I'm getting "TEXT_PRODUCT_MODEL." It's looking for the define in english.php but it's really in /includes/languages/english/template/product_info.php. How do I get it to look for it in the right file? Here's what I have so far:

    Code:
    $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . '<br>' . TEXT_PRODUCT_MODEL . ': ' . $listing->fields['products_model'] . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
    Also, anyone know how I can make the gap between product name and model number smaller?
    Assuming that your code hasn't been distorted by the forum itself or your process for getting in here, then the single quotes that surround each instance of 'product_id' and 'product_name' need to be escaped to avoid php interpreting them as the beginning or end of a non-evaluated text string.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Nov 2004
    Posts
    80
    Plugin Contributions
    0

    Default Re: Basic php question

    Escaped = deleted?

    That's the way they appear in the default template. I haven't messed with those at all.

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Basic php question

    Quote Originally Posted by besheer
    That's the way they appear in the default template. I haven't messed with those at all.
    You're absolutely right, my apologies. It's been a long day for me too. Can you post the section of HTML that this code generates?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Nov 2004
    Posts
    80
    Plugin Contributions
    0

    Default Re: Basic php question

    I know how that feels.

    It looks like this in the Product Name column:

    Comptech sport springs, RSX

    TEXT_PRODUCT_MODEL: 110-150
    The HTML looks like this"

    Code:
    <td class="productListing-data"><h3 class="itemTitle"><a href="http://www.tozka.com/shop/index.php?main_page=product_info&amp;cPath=162_22_30_33&amp;products_id=154">Comptech sport springs, RSX</a></h3><div class="listingDescription"><br>TEXT_PRODUCT_MODEL: 110-150</div></td>
    "TEXT_PRODUCT_MODEL" should read "Part #" instead, that's all.

    Thanks a lot for your help!

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Basic php question

    When you say that you want to put the model number under the product name in the product listing page, what do you mean by the product listing page? It's already there on the products_all page and the code needed to insert it into the product_info page is nowhere near as complex as the code that you have written. So I'm a little puzzled as to where the php that we are looking at is being inserted.

    Having been able to make the changes that I thought you were trying to achieve in a test environment with absolutely no problem, I suspect that where you have inserted the new code, rather than the code itself, is the key to this.

    Also, when I look at the code at your site, it suggests to me appears that you are using a template based on the default_template for v1.3+, but the code that you are inserting looks a bit less modern. Please could you confirm your version numbers and template basis.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Basic php question

    Quote Originally Posted by kuroi
    I'm a little puzzled as to where the php that we are looking at is being inserted.
    I'm no longer puzzled by this, just not wholly convinced that it's the right place for it. So let me rephrase my question. and I apologise in advance if it seems like a dumb thing to ask, on which pages do you want the part number to appear as you described in your original post?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #8
    Join Date
    Nov 2004
    Posts
    80
    Plugin Contributions
    0

    Default Re: Basic php question

    When you click on any category or subcategory that has products in it, that list that comes up before you go into the actual product info page. That's where I want to put it. There's a column for image, model number, product name, price, etc. I want to put the model number in the same cell with the product name and delete the whole model column. The first problem is that "Part number" is not coming up. Instead, I'm getting that TEXT_whatever part. Second problem is that when I turn off the model column from the admin, the model number disappears from both columns...mode and product name.

    I'm running 1.3.0.1 and template_default as the base. That bit of code that I posted is in /templates/MY_TEMPLATE/templates/product_listing.php around line 120, a few lines under
    Code:
    case 'PRODUCT_LIST_NAME':

  9. #9
    Join Date
    Nov 2004
    Posts
    80
    Plugin Contributions
    0

    Default Re: Basic php question

    I can post a screenshot if it will help.

  10. #10
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Basic php question

    I am by no means a coder, but copied from your first post:

    Code:
    . 'products_id=' . $listing->fields['products_id'])
    
    . TEXT_PRODUCT_MODEL . ': ' .$listing->fields['products_model']
    it appears that like 'products_id=' your TEXT_PRODUCT_MODEL. is missing the single quote and the equals sign

    should it be . 'TEXT_PRODUCT_MODEL=' .

    and then scrap the ': ' . that currently trails the . TEXT_PRODUCT_MODEL .

    Again I am not a coder buit this did not seem to match the convention for the other entries.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Bridging To PHP Fusion 7 Basic Question?
    By afliktion in forum General Questions
    Replies: 3
    Last Post: 22 Oct 2011, 05:35 AM
  2. basic UPS question
    By thepartydj in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 11 Jan 2009, 06:31 AM
  3. Basic Question
    By iDartsOnline in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 21 Jun 2008, 07:42 AM
  4. Super basic question!
    By sroberts209 in forum General Questions
    Replies: 2
    Last Post: 9 Apr 2007, 08:08 PM
  5. Basic Layout Question
    By slabadoo in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 Jan 2007, 03:48 PM

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