Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default adding barcode to product listing layout help required

    hi,
    i am adding barcode to my product listing and need help putting the code in, i need to add this code to product listing

    PHP Code:
    <div id="barcodeimage"><IMG SRC="barcode.php?barcode=<?php echo $listing->fields['products_ean']; ?>&width=320&height=200"></div>
    i need to add it here

    PHP Code:
    $lc_text .= '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'


    hope someone can help. then im going to hide the barcode on stylesheet and only let it show when printing for instore use with barcodes but cant seem to get it added and work

    http://www.onyourbike.co.uk/clearanc...rthern-ireland

    thank you for any help

    bryan

  2. #2
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: adding barcode to product listing layout help required

    Try this
    PHP Code:
    $lc_text .= '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3>
    <div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div><br /><div id="barcodeimage"><IMG SRC="barcode.php?barcode=<?php echo $listing->fields['products_ean']; ?>&width=320&height=200"></div>';

  3. #3
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default Re: adding barcode to product listing layout help required

    thanks for help but just blank page with this code,

    thanks
    Bryan

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

    Default Re: adding barcode to product listing layout help required

    There is a comma instead of a dot in the first line of that code:

    $listing->fields['products_id']), 'cPath=' . (($_GET['manuf
    $listing->fields['products_id']) . 'cPath=' . (($_GET['manuf

    Corrected:
    PHP Code:
    $lc_text .= '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']) . 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3>
    <div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div><br /><div id="barcodeimage"><IMG SRC="barcode.php?barcode=<?php echo $listing->fields['products_ean']; ?>&width=320&height=200"></div>';

  5. #5
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default Re: adding barcode to product listing layout help required

    no still not getting it to work,

    bryan

  6. #6
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default Re: adding barcode to product listing layout help required

    getting closer

    PHP Code:
    $lc_text .= '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' .
            
    '<div id="barcodeimage"><IMG SRC="barcode.php?barcode=' $listing->fields['products_ean']; '&width=400&height=200"></div>'
    but it is ignoring the size part of url

    &width=400&height=200

    so image is now in correct place but wont generate barcode because it needs size part of image

    thanks for help so far

    bryan

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

    Default Re: adding barcode to product listing layout help required

    p?barcode=' . $listing->fields['products_ean']; '&width=400&height=200"></div>';
    should be
    p?barcode=' . $listing->fields['products_ean'] . '&width=400&height=200" /></div>';

  8. #8
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default Re: adding barcode to product listing layout help required

    well got there in the end, thanks again for help, i have also attached the file to generate the barcode incase anyone wants it, if you want to see it working go to print preview as its only there im going to show it but you can show on screen as well

    thanks
    bryan

    PHP Code:
    $lc_text .= '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' .
            
    '<div id="barcodeimage"><IMG SRC="barcode.php?barcode=' $listing->fields['products_ean'] . '&width=280&height=100"></div>'
    Attached Files Attached Files

  9. #9
    Join Date
    Apr 2010
    Posts
    319
    Plugin Contributions
    0

    Default Re: adding barcode to product listing layout help required

    ok now what i thought was going to be the simple part seems harder than i thought,

    in stylesheet i used
    HTML Code:
    #barcodeimage  { display: none;}

    hoping this would hide the barcode on screen but when i got to the print it would show, just like ive hidden a lot more things on page but when i add this code it disapears completely on both screeen and print

    maybe this should be posted as a new question

    thanks
    bryan

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

    Default Re: adding barcode to product listing layout help required

    Note that for proper XHTML validation, the <img tag needs to be self-closed with a / at the end:

    &width=400&height=200" />


    You should have a print_stylesheet.css in your /css/ folder (if not, copy it from /template_default/css/). Add
    #barcodeimage { display: block;}
    to this file.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Product Listing Layout Help
    By nolsowski in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 26 Jun 2011, 07:56 PM
  2. Product Listing Layout Help
    By cchan in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 5 Jun 2011, 09:45 PM
  3. Barcode packing slips usage - where to asign barcode to product
    By cornelmarian in forum Addon Shipping Modules
    Replies: 0
    Last Post: 10 Mar 2011, 11:00 PM
  4. Product Attribute layout help required [example link added]
    By aftab1003 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 8 Nov 2010, 02:15 AM
  5. Help with IE product listing layout
    By grayceworks in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Feb 2007, 02:09 AM

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