Kryptronic Software Support Forum

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.

#1 11-22-2016 19:58:08

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

Copy Submit button on Product Review to the top of the form

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

 

#2 11-23-2016 05:37:00

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: Copy Submit button on Product Review to the top of the form

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

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.


Rob

Offline

 

#3 11-23-2016 05:58:58

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

Re: Copy Submit button on Product Review to the top of the form

Thanks for that, but I don't know *where* to add the code! :-(

Offline

 

#4 11-23-2016 06:09:44

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: Copy Submit button on Product Review to the top of the form

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


Rob

Offline

 

#5 11-24-2016 16:47:25

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

Re: Copy Submit button on Product Review to the top of the form

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

 

#6 11-25-2016 08:53:01

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Copy Submit button on Product Review to the top of the form

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.


Nick Hendler

Offline

 

#7 11-25-2016 09:45:30

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: Copy Submit button on Product Review to the top of the form

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.

Code:

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.


Rob

Offline

 

#8 11-28-2016 08:06:39

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

Re: Copy Submit button on Product Review to the top of the form

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

 

Board footer