Claudia Posted September 20 Share Posted September 20 I have setup a new section in my product listings that I use for some of my listings. It's Called Use With (or Related too). It shows images of items that can be used for that product listing along with a link to that item. My question is how do I get the image "th" class to work on these images? I have setup a new folder in the main images file (/public_html/images/related/) to store the images used. Here's a page example FYI - Here's a sample of the code I'm now using. I tried to put the img class="th" src code and rearranged the alt and title but it wouldn't take. <div class="title-related thinmarg-top">Use with Our:</div> <div class="row pad-topbottom"> <div class="small-12 medium-3 large-3 columns center"> <a href="/tealight-candles-and-more"><img alt="Tealight Candles" src="../images/related/candle-tealight-lot-5-150.jpg" style="border-width: 0px;" title="Tealight Candles" /></a><br /> <a class="related center" href="/tealight-candles-and-more" target="_blank" title="Tealight Candles">Tealight Candles</a> </div> Thanks for any all help!!! Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 20 Share Posted September 20 Works for me: <img class="th" alt="Tealight Candles" src="../images/related/candle-tealight-lot-5-150.jpg" style="border-width:0;" title="Tealight Candles"> Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 20 Author Share Posted September 20 I don't know if that will work for me or not. Even when I change my code, the frontend page still shows the original, though the admin shows the changes. Here's my revised testing code. I have even checked my admin product skin and source codes. <div class="small-12 medium-3 large-3 columns center"> <a href="/tealight-candles-and-more" title="Tealight Candles"><img class="th" alt="Tealight Candles" src="../images/related/candle-tealight-lot-5-150.jpg" title="Tealight Candles"></a><br /> <a class="related center" href="/tealight-candles-and-more" target="_blank" title="Tealight Candles">Tealight Candles</a> </div> Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 20 Share Posted September 20 I change my code -- from what to what? Still shows the original -- what? Is this "code" actually part of the product's Description? Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 "I change my code -- from what to what? " From the code in the original post to what you gave me "Still shows the original -- what? " from the code in the original post "Is this "code" actually part of the product's Description? " No it's a new section I created .... It all worked (not the "th" in 6.5.1). I guess if I had to I could add it to the product description. ADMIN PRODUCTS SOURCES $record = $_POST; $record['description'] = $GLOBALS['RAW']['POST']['description']; $record['sold_venue_tag'] = $GLOBALS['RAW']['POST']['sold_venue_tag']; $record['related_used_with'] = $GLOBALS['RAW']['POST']['related_used_with']; unset($record['categories'], $record['group'], $record['image']); ADMIN PRODUCTS SKIN <fieldset> <legend style="width:99.5%">Sold Venue Tag</legend> <textarea name="sold_venue_tag" id="sold_venue_tag" class="textbox fck">{$PRODUCT.sold_venue_tag}</textarea> </fieldset> </td> <td width="1%"> </td> <td width="48%"> <fieldset> <legend style="width:99.5%">{$LANG.common.description}</legend> <textarea name="description" id="description" class="textbox fck">{$PRODUCT.description}</textarea> </fieldset> </td> </tr> </table> <table width="50%"> <tr> <td width="50%"> <fieldset> <legend style="width:99.5%">Related / Used With</legend> <textarea name="related_used_with" id="related_used_with" class="textbox fck">{$PRODUCT.related_used_with}</textarea> </fieldset> If I make it part of the description it works ... but.... it is placed above the products specs. and even though I delete the code in the related_used_with it still shows. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 Deleted Code from DataBase for related_used_with It works when I add the code to the product description, but it's in the wrong place. See link above. Do I need to add the related_used_with and specs to the product description? Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 21 Share Posted September 21 I see that in admin, there is a dedicated editor for 'related_used_with' - and I assume there is a database column for it. Have CubeCart's debug mode enabled. Save the edit screen after making sure that the class="th" is part of the <img> tag as seen above. In the debug window, CubeCart will show what was received in the POST payload. Confirm the <img> tag has the class="th" attribute. If this attribute is not present, then we might think that the editor is stripping it away. Which is strange. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 21 Share Posted September 21 "Do I need to add the related_used_with and specs to the product description?" You shouldn't have to. The content of the 'related_used_with' editor, being databased in a new column of the CubeCart_inventory database table, then retrieved as an element of all data found in that record, should be part of Smarty's $PRODUCT array. (I assume you had CubeCart clear its internal cache after saving the edited data.) Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 This is the part of debug in admin for the example page. 'related_used_with' => <div class="title-related thinmarg-top">Use with Our:</div> <div class="row pad-topbottom"> <div class="small-12 medium-3 large-3 columns center"><a href="/tealight-candles-and-more" title="Tealight Candles"><img alt="Tealight Candles" class="th" src="../images/related/candle-tealight-lot-5-150.jpg" title="Tealight Candles" /></a><br /> <a class="related center" href="/tealight-candles-and-more" target="_blank" title="Tealight Candles">Tealight Candles</a></div> <div class="small-12 medium-3 large-3 columns center"><a href="/scented-oils" title="Scented Oils"><img alt="Scented Oils" class="th" src="../images/related/scented-oils-lot-5-150.jpg" title="Scented Oils" /></a><br /> <a class="related center" href="/scented-oils" target="_blank" title="Scented Oils">Scented Oils</a></div> <div class="small-12 medium-3 large-3 columns center"><a href="/scented-tarts"><img alt="Scented Tarts" class="th" img="" src="../images/related/scented-tarts-lot-6-150.jpg" title="Scented Tarts" /></a><br /> <a class="related center" href="/scented-tarts" target="_blank" title="Scented Tarts">Scented Tarts</a></div> Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 21 Share Posted September 21 Other than a strange 'img' attribute on the third <img> tag, I do not see anything wrong. I will assume that the database record gets appropriately updated. You can find the respective database query in the list of Queries. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 I looked in myphp at that product and the record is updated Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 21 Share Posted September 21 Again, I assume you had CubeCart clear its internal cache after saving the edited data. That is necessary because the result from the query in the Catalogue class, function getProductData(), the database record will be pulled from CubeCart's internal cache - if it exists. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 Yes I click the clear cache button more than I should probably Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 21 Share Posted September 21 Please see if the order of the 'Use With' images for 'Tarantulas' changes on the storefront after you change the order in the editor. (And Clear Cache.) Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 no nothing changes. No matter what changes I make nothing changes Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 21 Share Posted September 21 We know that editing the product's description (having put the code in Angel and Child) does show the changes on the storefront. Please show the custom template code (5 lines before and 5 lines after) where the Smarty variable $PRODUCT.related_used_with is located. Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 Here you go. This is my skin code. {if $PRODUCT.specs_title_12} <div class="block_container"> <div class="bc-subtitle"> {$PRODUCT.specs_title_12}</div> {/if} {if $PRODUCT.specs_content_12} <div class="bc-txt">{$PRODUCT.specs_content_12}</div></div> {/if} {if ($PRODUCT.related_used_with)} <div> {$PRODUCT.related_used_with} </div> {/if} </form> <div class="hide" id="validate_field_required">{$LANG.form.field_required}</div> </div> {else} <p>{$LANG.catalogue.product_doesnt_exist}</p> {/if} Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 21 Author Share Posted September 21 I took the () out and it works! Thanks Brian FYI: I had the () in because that what shows in product description and I was just following what it did. Well I don't know what is going on now! I looked at another product that has this and look! Plus none of it is showing in the editor in the admin skin product page https://www.cambargainstore.com/candle-lamp-cowboys I got it to work Quote Link to comment Share on other sites More sharing options...
Claudia Posted September 22 Author Share Posted September 22 I'm just curious ... why did it make a difference taking out the ()? Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 22 Share Posted September 22 In my opinion, those parenthesis should have caused a different problem, resulting in not showing that content at all. Very strange! Parentheses are used to force an "order-of-math-operations", or as a "container" of function arguments. But, since there was no function name preceding the function argument "container", PHP should have complained about something wrong with the statement syntax. However, this was inside braces - which are reserved for Smarty statements. Thus, Smarty will "parse" its statements, compiling them into real PHP statements. You can see the compiled result files in the /cache/skin/ folder. For myself, the process by which Smarty parses its statements, and how it deals with anomalies, is unknown. Therefore, why Smarty would use "stored/cached" contents of a variable, let alone where those contents could possibly be stored/cached -- I have no idea. I do plan to conduct my own experiments to try to replicate this situation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.