Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Payment Proccessor My_Changes Override Rate Topic   - - - - -

 
  • dioskouros
  • Member
  • Members
  • Join Date: 21-Jul 10
  • 68 posts

Posted 13 June 2018 - 01:34 PM #1

Hello

 

I want to know if is possible to override the payment proccessor php file.

 

The file is located in root/app/payments/proccessor.php

 

What folder structure do I have to create so this file will be overridden ? It is a core file and I don't want to change it

 

thank you



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 13 June 2018 - 01:42 PM #2

Hello

 

I want to know if is possible to override the payment proccessor php file.

 

The file is located in root/app/payments/proccessor.php

 

What folder structure do I have to create so this file will be overridden ? It is a core file and I don't want to change it

 

thank you

 

Unfortunately, you cannot override it. But you can change script path during addon installation and return it back during uninstallation 


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dioskouros
  • Member
  • Members
  • Join Date: 21-Jul 10
  • 68 posts

Posted 13 June 2018 - 03:47 PM #3

Can you please explain how I can do this ?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 14 June 2018 - 06:24 AM #4

For example, you can add the following code to the addon.xml file

    <functions>
        <item for="install">fn_my_addon_install</item>
        <item for="uninstall">fn_my_addon_uninstall</item>
    </functions>

Then just create corresponding functions in the func.php file where corresponding requests to database can be done

 

Alternative way - to specify SQL requests in the addon.xml file directly

    <queries>
        <item for="install">UPDATE ?:payment_processors SET processor_script = 'aaa.php' WHERE processor_script = 'bbb.php';</item>
        <item for="uninstall">UPDATE ?:payment_processors SET processor_script = 'bbb.php' WHERE processor_script = 'aaa.php';</item>
    </queries>

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dioskouros
  • Member
  • Members
  • Join Date: 21-Jul 10
  • 68 posts

Posted 14 June 2018 - 09:27 AM #5

Thanks a lot eComLabs,

 

That was the best solution I guess. I created a  simple addon with your queries inside 

<queries>
<item for="install">UPDATE ?:payment_processors SET processor_script = 'aaa.php' WHERE processor_script = 'bbb.php';</item>
<item for="uninstall">UPDATE ?:payment_processors SET processor_script = 'bbb.php' WHERE processor_script = 'aaa.php';</item>
</queries>

But I noticed a strange thing. I clicked the install button from addons area, the script has successfully changed inside database, but the addon is not marked as installed. 

Have you got any clue ?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 14 June 2018 - 01:29 PM #6

Thanks a lot eComLabs,

 

That was the best solution I guess. I created a  simple addon with your queries inside 

<queries>
<item for="install">UPDATE ?:payment_processors SET processor_script = 'aaa.php' WHERE processor_script = 'bbb.php';</item>
<item for="uninstall">UPDATE ?:payment_processors SET processor_script = 'bbb.php' WHERE processor_script = 'aaa.php';</item>
</queries>

But I noticed a strange thing. I clicked the install button from addons area, the script has successfully changed inside database, but the addon is not marked as installed. 

Have you got any clue ?

 

Does it work correctly if you remove these additional lines of code?

 

Make sure that the addon directory name matches the id tag in addon.xml


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • dioskouros
  • Member
  • Members
  • Join Date: 21-Jul 10
  • 68 posts

Posted 14 June 2018 - 04:30 PM #7

Thank you,

 

It was just the issue



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 15 June 2018 - 06:07 AM #8

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.