Guestbook
Those who work with the Shop-Scrip Webasyst system will understand me. Certainly find something useful and those who use earlier versions of this script.
As a store, it is very good: order form, product comparison, etc. But a few additions are still missing. The first were the guest book (so that grateful buyers could tell us thanks, and we could boast of it to everyone), a photo gallery and a feedback form for those whom something did not like (something like “complain about the order”).
Shop-script is not structured in the same way as Joomla and simply adding the module or component we need will not work. But there is a way out. I will describe how I did.
Let's start with the guest book.
Implementation:
- In the file \ published \ SC \ html \ scripts \ templates \ frontend \ aux_page.html after the opening "{" add - eval var =
- In the \ published \ SC \ html \ scripts \ smarty \ plugins folder, create a function.guestbook.php file with the content:
<?php<br/>
function smarty_function_guestbook($params, &$smarty) {<br/>
<br/>
// , ,<br/>
<br/>
$result='Hello world!';<br/>
return $result;<br/>
}<br/>
?>
- We create an information page on which our guest book will be displayed and in the html editor, add {guestbook}
- Why everything is exactly so written here .
- I think the guest book code is not necessary to bring :)
- In order for us to be able to administer our guestbook (after all, anything can happen), Shop-script has a variable $ _SESSION ['log'] , which is only if the user is authorized on the site and whose value is equal to that user's login. By checking this variable, you can distribute the rights to delete and edit records to anyone.
New payment module:
Task:Introduce a new-fashioned payment method provided by the Ukrainian bank. Naturally, the creators of shop-scrip have not heard anything about this payment method and have not listed it.
')
I will describe how I solved the problem. Maybe not quite right, but maybe someone will do it too.
I did not redo any of the existing ones (and suddenly it will come in handy), but made a new
First, through the admin panel I will create a new payment method:
Settings -> Payment -> Add Payment Method -> Manual Payment Processing -> Custom Payment Method

You need to change just a couple of files and add one.
in the
/published/SC/html/scripts/modules/abstract/_methods/checkout/billing.php file
(don't ask how i found it)
in the select_payment () function (this is approximately line 20) replace the last line
"RedirectSQ ...." on
$r=$this->getData('paymentMethodID');<br/>
RedirectSQ('step=confirmation&s='.$r);
We create a new plugin, for example,
function.mypay.php in the /
published / SC / html / scripts / smarty / plugins folder with a code roughly related to:
<?php<br/>
function smarty_function_mypay($params, &$smarty) {<br/>
$display='';<br/>
$ord=' ';<br/>
if ($_GET['s']==12)<br/>
{<br/>
$display.=''; // . submit, <br/>
} else {<br/>
$display.='<p><input type="submit" class="checkout_buttons" name="submit" value="'.$ord.'" /></p></form>';<br/>
}<br/>
echo $display;<br/>
}<br/>
?>
And edit the template file:
/published/SC/html/scripts/templates/frontend/checkout.confirmation.htmlafter 85 lines insert
and after {else} we insert the output of our plugin {mypay} and delete everything else before the {/ if} tag
How to find out the id of the payment method?In the admin panel it is enough to point at the “edit” link opposite the desired payment method and in the status line we will see the link address and the last parameter (& pid = number), this number is the id that we need.
Something like this. works for me.