Adding class attribute to osCommerce tep_image function

自闭症网瘾萝莉.ら 提交于 2019-12-17 20:42:05

问题


I'm trying to make my product image format a certain way using CSS, but I'm not sure where to add the following code to the tep_image function call:

class="single-product"

I want the generated image to have the extra class attribute included as part of its HTML.

I'm hoping I don't have to add an if statement to the constructor class.


回答1:


The tep_image function is located in \includes\functions\html_output.php.

tep_image(DIR_WS_IMAGES . $product_info['products_image'], 
          addslashes($product_info['products_name']), 
          SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 
          'class="single-product"')

Any extra attributes you need to add to the image function will be after setting the image dimensions, so place the CSS as the fifth parameter.



来源:https://stackoverflow.com/questions/11494326/adding-class-attribute-to-oscommerce-tep-image-function

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!