| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Show product variant in list view instead of drop down | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Show product variant in list view instead of drop down
Hello Everyone & Specially Tony , i have been using x-cart 5 for my new project and quite like working on it.
Now i have to show product variant in list view instead of drop down list along with their name, price, sku, qty, Add to cart button. My Product consist of "ARTIST/AUTHOR" And "MEDIA TYPE" Attribute. Now my variant are based on "MEDIA TYPE" Attribute. I have seen one of your example and created this PHP Code:
I get getArtistAttributes() values as CSV for multiple values for authors/artists which is fine. When i call getMediaTypeAttributes() i get only the names in CSV where want variant information like price, sku, qty etc.. Please help on how to achieve this and thanks in advance. |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Show product variant in list view instead of drop down
Hi!
This is an example of how to pull info about variants: PHP Code:
This is a PHP script that must be put into X-Cart 5's root folder. Hopefully, it will help. If there is further help needed, please explain a bit what result you are trying to achieve. I still did not grasp it. Do you want to list product attributes on product lists (like category pages) or something different? Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#3
|
|||||||
|
|||||||
Re: Show product variant in list view instead of drop down
Thanks Tony your answer really helped a lot.
Another simple thing i want to ask. Now i want variant attribute values ID how do i get this information. I can get variant id using PHP Code:
Also, I cannot do var_dump() or print_r() from the views just for debugging purpose how can i do those. Debugging through var/run/ codes helps me now to not rebuild application so often. |
|||||||
#4
|
|||||||
|
|||||||
Re: Show product variant in list view instead of drop down
I have figured out how to do it on my own.
PHP Code:
In Template File Code:
Now you can have a list of variant with buy now button and clicking on it will add the specific variant to your cart. I hope this would help someone who is trying to figure out this kind of requirement. Also print_r is done like this Code:
|
|||||||
|
#5
|
|||||||||
|
|||||||||
Re: Show product variant in list view instead of drop down
Hi Jwala!
Thank you for sharing the code and happy to hear that you managed to apply the solution you need. Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
|||
X-Cart forums © 2001-2020
|