You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
I want to make things as easy as possible for people to add Reviews.
As such, I want to copy the Submit button which appears at the bottom of the Review Form and add it at the top as well so people can do the bare minimum to add a Review.
Problem is, I can't find where the form is generated so I can copy the code and put it at the top as well,
Can anyone point me to where I can find it?
Offline
Can't you just create a new button and get jquery to submit the form on click?
Create a new button with any id then add the following php code
$js_docready = 'jQuery(\'#NEWBUTTONID\').click(function(){'; $js_docready .= 'jQuery(\'#FORMIDGOESHERE\').submit();'; $js_docready .= '});'; $this->append_global_array('core.js_docready',$js_docready);
So now whenever the new button is clicked, jquery will submit the form.
Offline
I don't use the review system, but I would guess you would add it to the review include
private\apps\ecom\ECOM\includes\reviews.php
Offline
That doesn't seem to be it.
In private/apps/ecom/Ecom_Reviews/Ecom_Reviews.php there's a section "Function: reviewsf" which says "This function handles showing the review form", but I don't see anywhere it actually adds the submit button and I don't know how it operates.
Offline
That function leverages CORE_Form to build and display the form, so to modify it, you'll need to delv into the guts of the CORE_Form module. Probably not worth it to move a submit button. You have the potential to move every submit button on the site with one wrong coding move.
Offline
If you want to hack a core file, and I suggest you don't, you could add a line to the reviewsf function inside ECOM_Reviews.
Around line 330 you will find $result = $this->CORE_Form->print_form($spec_form); - this line prints the form in the popup window.
Just before that line add something like this, plus add any styling you require.
print '<button id="NEWBUTTONID">Fake</button>' . $eol;
This will add a button at the top of the pop up window form.
You can then add the jsdocready code. I would add this to the product detail display code.
Offline
Thanks for the advice, I think I'm going to have to leave this as it is.
I'd modified the Product Display to add a button at the top of the display that says "Click here to buy now" and which immediately jumps the customer down past the image and description to the Product Options or Add to Cart (if the product has options).
I'd hoped it would have been a similarly simple matter to do it for the Reviews. Clearly it's not, though :-(
Offline
Pages: 1