[msGallery] The resource with id = 9 is not instance of msProduct. 

How to pass id to modx revo minishop2

 <div class="action-view"> <button type="button" class="btn" name="ms2_action" value="cart/add" data-toggle="modal" data-target="#productModal"><i class="fa fa-search"></i>Просмотр</button> </div> <div id="quickview-wrapper"> [[! WayRowTpl]] × [[! MsGallery]] <div class="product-info"> <h1>[[*pagetitle]]</h1> <div class="price-box"> <p class="price"><span class="special-price"><span class="amount"><b> [[+price]] [[%ms2_frontend_currency]]</b></span></span></p> </div> <p class="availability in-stock">Наличие: [[*avaible:eq=`1`:then=`<span>В наличии</span>`]] [[*avaible:eq=`2`:then=`<span>Под заказ</span>`]] [[*avaible:eq=`0`:then=`<span>Нет в наличии</span>`]] </p> <a href="product-details.html" class="see-all">Перейти к товару</a> <div class="quick-add-to-cart"> <form method="post" class="cart"> <div class="add-to-box add-to-box2"> <div class="add-to-cart"> <div class="input-content"> <label for="qty">Количество:</label> <input type="button" class="qty-decrease" onclick="var qty_el = document.getElementById('qty'); var qty = qty_el.value; if( !isNaN( qty ) &amp;&amp; qty &gt; 0 ) qty_el.value--;return false;" value="-"> <!--<input type="text" class="input-text qty" title="Qty" value="1" maxlength="12" id="qty" name="qty">--> <input type="number" name="count" id="product_price" maxlength="12" class="input-text qty" value="1"/> <input type="button" class="qty-increase" onclick="var qty_el = document.getElementById('qty'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;" value="+"> </div> [[*avaible:neq=`0`:then=` <button type="submit" class="btn" name="ms2_action" value="cart/add"><span>Добавить в корзину</span></button>`]] </div> </div> </form> </div> <div class="quick-desc"> [[*description]] </div> </div> </div> </div> </div> </div> 
  • Repetition of the question is not welcome - try to rephrase the question or add new details that you found out on this issue. As an option - you probably have a source of data - let us see what data will be transmitted to the syud (just don't need everything - only in the area id 7 - 11). Otherwise, the comment to the copy of this question correctly describes the first thing that comes to mind - check that the data type of the transmitted objects is suitable for msProduct. Perhaps under the index 9 is either null or other data. And maybe just go beyond the limits of the listing. - alexoander

1 answer 1

You have a big problem with specifying any details of what you want, but what you wrote in the title is usually done in mods like this:

The first is that you display a link to your product when you click on it to open a modal window. Something like that:

 <a href="[[~адишниктовара]]" class="show_me_all_things">названиетовара</a> 

Before going further, you need to prepare a template for the product itself - to wrap the content that you want to bring to the div with an ad to which we will subsequently cling:

 <div id="our_modal_content"> ...тут весь твой контент товара который нужно выводить в модальном окне... </div> 

Then we link the click event handler via javascript to the class and open the modal window - for example, through the colorbox (css and js colorbox files must be connected to the page):

 <script> $(document).ready(function(){ $(".show_me_all_things").colorbox({ href: function() { return $(this).attr('href')+' #our_modal_content'; } }); }); </script>