1 Attachment(s)
Re: How-To: Add new Properties to your Products
Okay its 2.17am and it`s time for bed.
Spent the last 30 mins or so looking at logs and rectifying the errors where I had put a , after all the ink_ml
Also the last file to edit was not the one in the default template but the RSB folder.
We now have 99% success, here is the data exactly where I want it ..
Attachment 17255
Problem is in step 3 rather than using Guarantee (In Months) I put Ink Or Toner Capacity but nothing is showing only a 6 that is coming from the database ??
Re: How-To: Add new Properties to your Products
Generally speaking for "home use" (meaning unless there is a specifically considered reason), it is wise never to modify the template_default files. They are a stock, backup set of files that if they do not exist in a template override then they will be used. Take the statement with a heavy grain of salt, but there are a number of benefits of not editing the file(s) that are in there, doesn't mean can't add to those files or anything else, just a benefit to leave them be. How else will you be able to compare operation of the current template to a fully functional one?
As to the display, steps 3 and say 7 or 8 are completely distinct and unrelated. The original instructions were primarily about how to get the data to and from the database. There is additional language work to be done in the tpl_product_info_default.php file and associated includes/languages directory to make your addition more language friendly if you happen to go multi-language.
1 Attachment(s)
Re: How-To: Add new Properties to your Products
Im not that bothered about multi language MC and all the steps followed have given me the result I required however that 6 on the pic above just sits there with no info what it is LOL, ideally I would want something like this ...
Attachment 17256
Other than that everything is working a treat. I was thinking there maybe a variation to step 8 to include the text before 6 fetched from the database.
Re: How-To: Add new Properties to your Products
Found a post on page 9 that covers my question, I must have missed that. Edit done and now working perfect. MC yet again your a star. I put 6ml in the product edit but it will not hold the ml part but I`m assuming that's down to the database field I`ll look into that but other than that perfect. Store is now ready to launch :) thanks again MC on this and all the other threads you`ve solved for me ;)
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
MCS_Computers
Found a post on page 9 that covers my question, I must have missed that. Edit done and now working perfect. MC yet again your a star. I put 6ml in the product edit but it will not hold the ml part but I`m assuming that's down to the database field I`ll look into that but other than that perfect. Store is now ready to launch :) thanks again MC on this and all the other threads you`ve solved for me ;)
Your field (ink_ml) is likely some numeric value like a float or an int, therefore the text ml will not get stored. Now, thing is, if you were able to add text before the value, you should be able to add text after it as well. Besides, why would you want to put something in a database field that is the same for every entry? What happens if one time you forget to add the ml? Then another, etc... if you're worried about displaying say 1,000 ml, then ok, might need something to help with that, but...
Welcome, glad you were able to find something of assistance. Trying to guide you to improvement as well as get your issues resolved.
Re: How-To: Add new Properties to your Products
You were right, prior to your post I went into PHPMYADMIN and saw that the ink_ml field was infact set to int, I made the relevant changes and now everything works well.
I needed this entry because ink cartridges are done in ml and toners are done in page yield so I just needed to identify what the number meant so although the number changes for each product I either want ml if its an ink cartridge or Page Yield if it is a toner.
I already had a CSV that I imported with EP so all I did was added another column to the CSV with ml and page yield and with a little excel addon merged the 2 columns together.
Worked a treat, you have helped me understand so much more than I did a few weeks ago and have been very patient, for that I thank you MC ;)
Re: How-To: Add new Properties to your Products
A big thank you to Chris for this tutorial... It's exactly what I've been trying to do in adding specific instructions for attributes and it works brilliantly!
In my mods, I've changed from an input field to a text area, which is working really well, but I'm looking to do some highlighting features (example below)
If I enter this - (edit- Sorry, what I've put below is NOT the code I'm using... it's an example of the data I put in. A bit confusing because I wrapped it in code tags)
Code:
<strong>Extra Attribute Info goes here</strong>
it saves it and shows it as this -
Code:
<strong>Extra Attribute Info goes here</strong>
The idea is to make any instructions prominent for customers to see with <strong>, <br>, <h7> and so on...
When entering into the "Products Description", I can use those elements where they work as expected, but not in the extra field I've put in...
I'm at a loss now so I'm asking for clues where I've gone wrong...
Thanks in advance
John
Re: How-To: Add new Properties to your Products
Welcome to the new world of sanitization. ZC without knowing how the input is to be used, will "strip" such codes from the input for security sake as corrected for all of ZC 1.5.x here: https://www.zen-cart.com/showthread....d-TWSL2016-006
With direction of how to apply sanitization for your input contained in the first post which directs to here: http://docs.zen-cart.com/Developer_D...n_sanitization
Re: How-To: Add new Properties to your Products
That all makes sense now, thanks!
All I need to do is figure out how to use it... (with sanitizing disabled, everything works as I was expecting)
Thanks for your help, John
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
Foster660
That all makes sense now, thanks!
All I need to do is figure out how to use it... (with sanitizing disabled, everything works as I was expecting)
Thanks for your help, John
Looks like that docs link has been "moved", the most directly applicable (to ZC 1.5.5) is: http://docs.zen-cart.com/Developer_D...n_sanitization
Somewhat surprisingly, it's not too difficult to apply the desired sanitization once the regex stuff at the bottom is better understood (currently doesn't have "straight" words about what it allows/removes, just identifies the "code" of what it does).