I have few issues as I needed to re-organize how partials are being pulled:
1. product rating does not get activated
If I select a star I get a flash error message that nothing is selected.
Here I'm sure is a jQuery issue as the review form is outside of the shop:product_partial, being pulled from the product_page directly.
On product_page - part of the code
<!--product text-->
<div class="product-text">
<h1><?= h($product->name) ?></h1>
<? if ($product_unavailable): ?>
<h2>Product unavailable</h2>
<p>We are sorry, the product is unavailable.</p>
<p><a class="link_button" href="<?= root_url('shop')?>">Return to the Store</a></p>
<? elseif(!$product): ?>
<h2>Product not found</h2>
<p>We are sorry, the specified product cannot be found.</p>
<p><a class="link_button" href="<?= root_url('shop')?>">Return to the Shop</a></p>
<? else: ?>
<div id="product_page"><? $this->render_partial('shop:product_partial') ?></div>
<? endif ?>
</div>
<!-- product reviews -->
<div id="product_page_review" class="product-reviews">
<? $this->render_partial('shop:product_reviews') ?>
<? $this->render_partial('shop:add_review_form') ?>
</div>
</div>
On shop:add_review_form, I believe this line is messing up everything:
<?= open_form(array('onsubmit'=>"return $(this).sendRequest('shop:on_addProductReview', {onAfterUpdate: init_effects, extraFields: {no_flash: true}, update:{'product_page_review': 'shop:product_partial'}})")) ?>I don't understand this line. Why is it required the shop:product partial in the call? Is the page ID not enough? (which is also changed.)
update:{'product_page_review': 'shop:product_partial'}
2. When it gets posted there is no message and I need to refresh to see the change
This part doesn't take effect:
<? if (isset($review_posted)): ?> <p class="flash success">Your review has been successfully posted.</p> <? else: ?>
3. How would I go on initializing the form directly?
Currently you need to push this button, otherwise the rating stars don't show up:
<p id="review_trigger"><a href="#" class="link_button" onclick="$('#review_trigger').addClass('hidden'); $('#review_form').removeClass('hidden'); $('#review_title').focus(); init_rating_selector(); return false">Write a review</a></p>

Help












