Fix php, jquery code for magento 1.9 store

I have a magento 1.9 store that I have made a custom piece of code to show a 360deg image in an iframe.

I have managed to get the iframe to show on the product page but it has a few issues that I need help to fix. this should be fairly easy but a little past my novice rank with coding.

The current code has a foreach loop that shows the images for any specific product.

1. I need the link for the image to show at the end of the foreach loop.

My attempts to just add after <?php endforeach ?> ends with the thumbnail endlessly looping as it thinks its still part of the carousel css. Adding it outside makes it not part of the carousel.

I need it to add to the very end of the foreach loop as the last item if the statement exists.

2. once the thumbnail is loaded i would like the link to the iframe show in the .product-image div replacing the default image.

here is the code that I currently have )but not working yet)

I am attempting to add a couple of new elements to a Magento 1.9 image carousel on the products page.

Ideally I would like to add at the end of the foreach loop but whatever I do it just keeps duplicating the div...

The second issue is that I am having trouble getting the content of the div to show in the class="product-image" div on the product page.

My goal is to show thumbnail image at the end of the loop array and when you click on the thumbnail image it shows the content of the iframe in the div "product-image".

I have tried various bits of JavaScript but I can't get it to work. Also after trying to add to the end of the loop I have just ended up putting it on the outside of the div as there is other jQuery actions going on here that are forcing the new div I add after endforeach to duplicate endlessly.


show thumbnail at end of loop

link on thumbnail shows iframe in <div class="product-image">

Here is the code I have hacked... You must excuse me as I am complete novice at this and can read PHP Java ok but creating new code is a different story.

<div class="more-views additional-carousel">


$sliderFor = 4;

$productCount = count($this->getGalleryImages());


<div id="additional-carousel" class="<?php if ($productCount >= $sliderFor){?>product-carousel<?php }else{?>products-grid<?php }?> <?php if ($productCount <= 1): ?>mobile-tablet<?php endif; ?>">

<?php foreach ($this->getGalleryImages() as $_image): ?>

<div class="slider-item">

<div class="product-block">

<a href='<?php echo $this->helper(' catalog/image ')->init($_product, 'image ', $_image->getFile())->resize(768);?>' class='cloud-zoom-gallery lightbox-group' title='<?php echo $this->escapeHtml($_image->getLabel()) ?>' rel="useZoom: 'zoom1', smallImage: '<?php echo $this->helper('catalog/image')->init($_product, 'image', $_image->getFile())->resize(768);?>' ">

<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(768); ?>" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" />




<?php endforeach; ?>


<!-- if spinzam id exists in attributes-->

<?php if ($_product->getData("spinzam_id") == true):?>

<!-- thumbnail for spinzam link-->

<div class="slider-item">

<div class="product-block">

<a href="#" onclick="??"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(150); ?>"/>

<div class="uk-overlay uk-position-bottom product-block">






<!--content to add to .product-image div-->

<div id="spinzam" style="display:none;"><iframe src="[login to view URL]<?php echo $_product->getData(" spinzam_id ")?>" scrolling="no" style="max-width:100%; max-height:100vw;"></iframe>


<?php endif;?>


Skills: PHP, Magento, Javascript, CSS, jQuery / Prototype

See more: php code magento cms, magento add product store php code, jquery timetable php source code, magento 1 jquery in phtml, magento 2 jquery define, magento 2 speed optimization steps, jquery script magento 2, magento 2 speed optimization extension, magento 1 jquery, magento 1.9 speed optimization, magento 2 jquery, video chat script php jquery code, code php shopping cart magento, multiple choice php jquery code, run php code magento, php code collect data user store, cheap magento 1.9 2 templates, magento 1.9 to 2, magento, magento 1.9.2

About the Employer:
( 17 reviews ) Brisbane, Australia

Project ID: #20439202

Awarded to:


Hello, I have gone through your requirements as you are looking for the Full Stack developer. I have a +8 year of experience working with magento php with all other cms . I have knowledge of HTML, CSS, jQuery, A More

$70 AUD in 2 days
(242 Reviews)

8 freelancers are bidding on average $53 for this job


Hello there, I am interested and ready to start. I am a professional of back-end and front-end developments, and my skills are php, Laravel, Python, Angular, React, javascript, etc. And I have rich experiences in th More

$30 AUD in 1 day
(272 Reviews)

Hello sir. I have good skills and experiences as you requested on your project. You can see my results as follow. [login to view URL] [login to view URL] https://penguin More

$20 AUD in 7 days
(80 Reviews)

Hello Sir, I have read your job description regarding I have 6+ year of experience in this field. I have strong expertise to accomplish this project in decided time frame. Let's discuss in detail so that we never More

$70 AUD in 3 days
(126 Reviews)

Hello, I would like to thank you for considering my candidature for this job. I have analyzed your requirement for a PHP developer who can help to Fix php and jquery code for magento 1.9 store. I am having 5+ year e More

$100 AUD in 2 days
(42 Reviews)

Hey, I am a Senior Web Designer & Developer and I have over 3 years of experience in UI/UX Designing, HTML5/CSS3, JavaScript, JQuery, Bootstrap, WordPress & PHP, I am online and available let's discuss the project. T More

$20 AUD in 7 days
(8 Reviews)

Hello, “I’m interested in the position of "Fix php, jquery code for magento 1.9 store" you recently posted. I am dealing with Magento projects with the last 6 years. Please share the details with me & we are good to g More

$90 AUD in 7 days
(3 Reviews)

Hi, How are you doing today? I'm an expert who has 8+ years of experience with web development and design. I'm confident in HTML, CSS, Javascript, jQuery, Cpanel, SEO optimization, Plugins, and PHP. I've read your de More

$20 AUD in 7 days
(0 Reviews)