Jump to content

Get accessory link and image SSL safely from product page - Accessories miniatures as color swatch under add-to-cart


nicoledesignstore

Recommended Posts

Hello,

as per subject, I need a little hep to get accessory link and accessory image in an ssl compatible way from the product page itself without using any inclusion for other templates.

with some copy and past from various knowledge platforms, including this forum, I put together the following code, to be injected in the product-add-to-cart.tpl file of my custom theme:

			{if isset($accessories) && $accessories}
			<section class="available-also-color-size">
				
				<div class="available-also-color-size-container">
					<h3 class="page-subheading available-also-color-size-title" style=""><span>{l s='available also' d='Shop.nicole'}:</span></h3>
						<div class="available-also-color-size-grid" style="">
							{foreach from=$accessories item=accessory name=accessories_list}
								{if ($accessory.allow_oosp || $accessory.quantity_all_versions > 0 || $accessory.quantity > 0) && $accessory.available_for_order && !isset($restricted_country_mode)}
									{assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
								<div class="col-xs-2 available-also-color-size-title" style="">
												<a class="available-also-image-link"	href="{$accessory.link|escape:'html':'UTF-8'}" title="{$accessory.name|escape:'html':'UTF-8'}">
													<img class="available-also-image" style="" src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($accessory.legend)}{$accessory.legend|escape:'html':'UTF-8'}{else}{$accessory.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($accessory.legend)}{$accessory.legend|escape:'html':'UTF-8'}{else}{$accessory.name|escape:'html':'UTF-8'}{/if}" />
												</a>
								</div>
								{/if}
							{/foreach}
						</div>
				</div>	
			</section>
			{/if}

And the result is functionally and aesthetically pleasing (see attachment), but, as per title, It gives ssl errors randomly in allocating the needed resources for the content to appear.

May someone please tell me what is wrong in the way the code above is setting variables to links and resources? Is there any way to get those informations?

Please let me know!

Thanks

 

Schermata 2022-11-07 alle 11.29.44.png

Schermata 2022-11-07 alle 10.36.10.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...