I don't see the main image (from the product|image tab) on my upsell pages and wonder if someone that has it working can point to the latest code to show the image on that page so I can verify that I didn't muck it up at some point.
Announcement
Collapse
No announcement yet.
Levels > OUS1 > Main Image
Collapse
X
-
The upsell page does not access the image types by default. You can add this code to the page to display the main image though.
Code:<mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code('main', l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, 1, l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" /> <mvt:if expr="NOT ISNULL l.settings:imagedata:image"> <img src="&mvte:imagedata:image;" alt="&mvte:upsale:name;" title="&mvte:upsale:name;"> </mvt:if>
Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
-
No, this code functions natively.Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
Comment
-
It's dynamic so this should support whatever product is assigned to the upsell condition. IOW, doesn't need to be a single upsell item. It's the single item that matches the criteria for an existing item in the basket.
Scott
OOps, I think I interpreted "item" differently than you meant. I can't think of any API functions that require an item assigned to the page.Last edited by ids; 10-12-18, 09:07 AM.Need to offer Shipping Insurance?
Interactive Design Solutions https://www.myids.net
MivaMerchant Business Partner | Certified MivaMerchant Web Developer
Competitive Rates, Custom Modules and Integrations, Store Integration
AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
My T-shirt Collection is mostly MivaCon T-shirts!!
- 1 like
Comment
-
Code:<div class="column whole medium-half product-information--images"> <mvt:if expr="NOT ISNULL l.settings:upsale:thumbnail"> <img src="&mvte:upsale:thumbnail;" alt="&mvte:upsale:name;" /> <mvt:else> <mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code('main', l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, 1, l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" /> <mvt:if expr="NOT ISNULL l.settings:imagedata:image"> <img src="&mvte:imagedata:image;" alt="&mvte:upsale:name;" title="&mvte:upsale:name;"> <mvt:else> test: main image not found </mvt:if> </mvt:if> </div> <!-- end product-information--images -->
Comment
-
Try this:
Code:<div class="column whole medium-half product-information--images"> <mvt:if expr="NOT ISNULL l.settings:upsale:thumbnail"> <img src="&mvte:upsale:thumbnail;" alt="&mvte:upsale:name;"/> <mvt:else> <mvt:do file="g.Module_Library_DB" name="l.success" value="ImageType_Load_Code('main', l.settings:imagetype)"/> <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, l.settings:imagetype:id, l.settings:imagetype)"/> <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)"/> <mvt:if expr="NOT ISNULL l.settings:imagedata:image"> <img src="&mvte:imagedata:image;" alt="&mvte:upsale:name;" title="&mvte:upsale:name;"> <mvt:else> test: main image not found </mvt:if> </mvt:if> </div> <!-- end product-information--images -->
Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
- 1 like
Comment
-
I'm glad it worked for you. Actually, I forgot to change the ID of the image type to a variable instead of it being static, just in case the main image was not ID 1.Matt Zimmermann
Miva Web Developer
Alchemy Web Development
https://www.alchemywebdev.com
Site Development - Maintenance - Consultation
Miva Certified Developer
Miva Professional Developer
https://www.dev4web.net | Twitter
- 1 like
Comment
-
This is a partial (div) of what I have on a production site using LEVELs RT:
Code:<div class="column whole medium-half product-information--images"> <mvt:if expr="NOT ISNULL l.settings:upsale:thumbnail"> <img src="&mvte:upsale:thumbnail;" alt="&mvte:upsale:name;" /> <mvt:else> <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:upsale:id, 1, l.settings:imagetype)" /> <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" /> <mvt:assign name="g.thisUpsaleImage" value="g.baseurl $ l.settings:imagedata:image" /> <img src="&mvte:global:thisUpsaleImage;" alt="&mvte:upsale:name;" /> </mvt:if>
Scott
Need to offer Shipping Insurance?
Interactive Design Solutions https://www.myids.net
MivaMerchant Business Partner | Certified MivaMerchant Web Developer
Competitive Rates, Custom Modules and Integrations, Store Integration
AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
My T-shirt Collection is mostly MivaCon T-shirts!!
- 1 like
Comment
-
Looks like Matt got to it first.
Scott
Need to offer Shipping Insurance?
Interactive Design Solutions https://www.myids.net
MivaMerchant Business Partner | Certified MivaMerchant Web Developer
Competitive Rates, Custom Modules and Integrations, Store Integration
AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
My T-shirt Collection is mostly MivaCon T-shirts!!
Comment
Comment