ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Zen Cart v1.54
SBA v1.54
Zen Magnific v1.5
So, I can get the main product image to change according to the attribute selected, but I've hit a brick wall when it comes to clicking on the attribute image to view its larger version.
I'm using a lightbox to display the larger images but for simplicity sake and to make it more relevant to this thread it might be best to use the stock SBA code in tpl_modules_main_product_image.php
Code:<script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image(addslashes($products_image_medium), addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,'id="SBA_ProductImage"') . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>'); //--></script>
I think that the
has to be replaced with something likeCode:FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']
with the $products_image_large being defined in \modules\main_product_image.php and I probably need to reference the 'attributes_image' field from TABLE_PRODUCTS_ATTRIBUTESCode:$products_image_large, $products_name, LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT
I'm stuck. Has anyone been able to get a larger version of the attribute image?
If it helps, the relevant bit of my lightbox (Zen Magnific) code in tpl_modules_main_product_image.php is
Code:document.write('<?php echo $relBOF . '<a href="' . zen_magnific($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" class="' . "nofollow" . '" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,'id="SBA_ProductImage"') . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' . $relEOF; ?>');
Great, I've been able to get the large image of the attribute in my lightbox by using
in the link to the larger image. Trouble is it only links to the last attribute in the set and doesn't 'switch' when SBA switches the main product image.Code:$products_options->fields['attributes_image']
I added the previous post to the github repository to address this overall issue. I haven't looked into it yet, but it would seem that the overall process isn't taking into account the jscript/jquery (whatever was used) transformation/status of what is changed. Either, SBA isn't providing the modified image with the standard data to support the follow-on lightbox, or perhaps not the data necessary to support it.
Yes, providingas a substitution in the php will only result in the last attribute_image that has a value. Instead, there needs to be some form of javascript applied/available that would then serve/substitute the information necessary to move on to the next action of the lightbox displaying the desired image...Code:$products_options->fields['attributes_image']
Overall, I believe that this feature is still in development although it has not been something that I have put focus on in comparison to the other functional aspects of the base SBA processing and display.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Thank you for that. I think I also concluded that jscript was need to make the change - I had a play but to no avail.
As a workaround, I've copied the attribute images as additional images - this means that when the dynamically displayed attribute images are clicked a large version (additional images) are shown in the lightbox.
The issue with this is that the first image displayed in the lightbox is not always the same as the attribute that was clicked,
and the additional images on the product_info page need to be hidden.
Both of these I can live with for the time being.
Thanks again
Simon
Apologies if this has been raised before, I did a search and did not find anything!
If I have a product where more than one attribute is set as "dropdown" then no attributes show up on the product listing. I mean there are no attributes shown to select or choose from.
Is there a fix for this or is it a feature :)
I have the latest plug in from the plugins section, classic template and v1.5.1.
This is partially a "feature". There are a few things. One verify the stock quantity in your admin for the product and it's individual variants. Basically if stock is present for one or more combinations of the attributes for that product and no choices appear on the product info page, then verify that the page passes html validation. If the attribute combinations are out-of-stock, you could setup the variants to be displayed with out-of-stock next to them. If however, it is not desired to identify out-of-stock, at the there is not yet a statement added to state that the product is out-of-stock and this results in "blank" being shown.
It is identified in the sequenced_sba_dropdown code where such a statement is needed, but it hasn't been written yet... It isn't expected to be difficult/complex, just hadn't done it yet and wasn't sure what wording would be desired. :)
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
i am using SBA Version 1.5.4 for Zen Cart Version 1.5.4, but on zencart 1.5.3
is working, but with a few niggles
one of them being the sort order of colours, e.g. https://www.jarbon.com/alpaca-socks/...-country-socks, if you first select shoe size you will then see the colour options, these are in the incorrect order, as set in attributes controller
SBA is setting the sort order by attribute value ID, lowest first:
<select name="id[3]" onchange="i3(this.form);">
<option value="0" selected="selected">Next select colour</option>
<option value="18">Black </option><option value="21">dark green </option><option value="272">Red </option><option value="367">damson </option><option value="370">natural white </option></select>
this is overriding the order i set in attributes controller
i tried using the sort order you get when adding stock, but this didnt work
any ideas how this might be fixed?
Bookmarks