I have a website that sells gaming related stuff, i need to show some buffs as icons/small images under every product below the product image, on the archive/category page, apparently there is no such option nor plugin on the internet that can help me (i would like to be corrected on this please)
So i am trying to work around this on my own, i have very basic coding knowledge.
They way i am trying to do it is by:
I can display the attributes and there values using the following code
The code above shows the corresponding attribute name and their values on the product cat/archive page,
The attribute pa_token has images attached to their values,
I want the pa_token to output its attached images instead of values, in the below example the code for pa_token is a representation of what i want its not a working code,
I need advice if this is a good approach or is there already a solution for this ? If not then how can i go about calling the images attached to the attributes!
When i put this code
I get the following output
a, bb are the sub attributes/values that have images attached to them
pa_token-> a – Icon 1, bb – Icon 2
So if i do the following code
I get the following output, looks like we are heading to the right path
I guess we have the meta now, now what should be the relevant code to only output the images with there tooltips on the category/archive page ?
By updating the code to :
i get the below output
So i was not able to solve my problem earlier, then i switched the plugin to Category and Taxonomy Image by Aftab Hussain and used the following code to call images on the category/archive loop page:
pa_token is my attribute with sub attributes that have images
foreach loop is used to output all the sub attributes used per product, otherwise it will output only the first result.
(array) inside foreach loop is used to not return anything if the value is null, otherwise all the other products with no attributes get an ugly php debug error on the main page, let me know if there is a non hack way to handle this.
Thanks for your help guys for giving me the right direction.
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com