Hi David
I've been working on a test site and I must say your product is great. As I get more into it, I've formed a short wishlist of things I'd like to do. I think it's all pretty basic stuff but I'd appreciate if you could point me in the right direction as I'm totally new to php.
So, I'd like to know how I can...
- remove the 'search or browse by merchant' link from under the search box. I want to keep 'by brand' and 'by category' though.
- add an image/s to replace the merchant name/s in the column headed 'stockist' on the product page
- make the abovementioned merchant image a link that points to the same place as 'visit store' (namely to the merchant's web page).
- make the main image on the product page (the best price one) a link which also points to the merchant's relevant web page (same target as 'visit store')
- restrict number of search results (say to 2 pages' worth)
- use the filter tool in such as way as to insert dynamic elements after the Product Name and have the URL still work. Reason is I want to insert the Category name after the product name. But if I put %CAT/AWCAT% in the Text After Name filter it renders the product url dud (the url from the results page to the product page I mean).
I hope I've been clear. Thanks a lot,
Oliver
Hi David
Thanks a lot for the clear instructions - I was able to make all of the changes smoothly.
The URLs were breaking when I added characters (such a > & or -) to the Text After Name filter so I got it working by keeping it simple and just using words in there. All seems fine now.
Thanks again,
Oliver
Hi David
Just a quick one...I dynamically insert the product name again into the page on products.php title by using:
$header["title"] = $q $q
...but is there a similar piece of code that I can drop in that will also insert the relevant product category into the page title as well? I tried %CAT/AWCAT% but that didn't work.
Thanks
Oliver
Hi Oliver,
On the product page, the category is in the record that has been read from the database, so it doesn't use the %FIELD% terminology at that point. Where you set the title, you can bring the category in using the $product["products"][0]["category"], for example:
$header["title"] = $q . " " . $product["products"][0]["category"];
Cheers,
David.
Thanks David, works great. Do you have a similar instruction to pull in the brand?
Cheers
Oliver
Hi Oliver,
It's there in $product["products"][0]["brand"]
Cheers,
David.
Hi Oliver,
remove the 'search or browse by merchant' link from under the search box. I want to keep 'by brand' and 'by category' though.
This is a simple modification to index.php. You will find the code that displays the merchant part of the links on line 18 - simply delete that or modify the text / links as required.
add an image/s to replace the merchant name/s in the column headed 'stockist' on the product page - make the abovementioned merchant image a link that points to the same place as 'visit store' (namely to the merchant's web page).
There's a few steps involved in this but several users have implemented this mod - all the code is in the following thread (the code for making it a link is a few comments down):
http://www.pricetapestry.com/node/314
make the main image on the product page (the best price one) a link which also points to the merchant's relevant web page (same target as 'visit store')
To do this, you'll find the following code starting at line 6 of html/product.php:
<?php if ($mainProduct["image_url"]): ?>
<img width='180' src='<?php print $mainProduct["image_url"]; ?>' alt='<?php print $mainProduct["name"]; ?>' />
<?php endif; ?>
To make the image a link, change this as follows:
<?php if ($mainProduct["image_url"]): ?>
<a href='<?php print tapestry_buyURL($mainProduct); ?>'>
<img border='0' width='180' src='<?php print $mainProduct["image_url"]; ?>' alt='<?php print $mainProduct["name"]; ?>' />
</a>
<?php endif; ?>
restrict number of search results (say to 2 pages' worth)
Although this won't have any impact on speed, you could max the result count to 2 pages worth by the changing the following code from search.php starting at line 91:
database_querySelect($sqlResultCount,$rows);
$resultCount = $rows[0]["resultcount"];
...as follows:
database_querySelect($sqlResultCount,$rows);
$resultCount = $rows[0]["resultcount"];
if ($resultCount > ($config_resultsPerPage*2))
{
$resultCount = ($config_resultsPerPage*2);
}
Regarding adding the category to the product name, can you see why it is rendering the URL dud? Is this because of invalid characters? If this is the case it may be necessary to do a Search and Replace on the combined product name after the Text After filter, but this shouldn't be necessary as the category field is also sanitised during import. Can you post an example of the combined product name that is causing the URL to break?
Cheers,
David.