问题
I am working on Opencart 1.5.1.3
On the product display page, it's displaying the Active Special Price and also the Normal Price with a line in the middle.
For all special prices available for a product I want to display: the special price with its start and end date
I tried my best by changing data in the tpl file and also in the module php file, but it didn't work.
How can I do this?
回答1:
I can't give you the exact code because I don't want to change my own installation, but you would need to change /catalog/model/catalog/product.php and edit line~14 "$query = ..." so that it returns the start and end date to the controller.
Then edit /catalog/controller/product/category.php line~187 and add to the array "$this->data['products'][] = array(" the start and end date information.
You should now be able to access that information and format it however you want in /catlog/view/theme/THEME/template/product/category.tpl
来源:https://stackoverflow.com/questions/8015765/opencart-1-5-1-3-display-special-price-with-start-and-end-date-on-product-displa