Jump to content

adding external php code to and existing page document


Guest Dazmanjunket

Recommended Posts

Guest Dazmanjunket

Hi just wondering being new to Cubecart where do I need to look to start adding some external php/java/ajax code to and existing document in the main content page>

I have created a document in the admin panel for partner searches, which will use a store locator postcode search with geocoding, do I need to create a separate .php file or can I add the code for the external web app straight to the page editor using the source option in the editor?

Any help would be useful.

Link to comment
Share on other sites

Guest john323232

You must study SMARTY, in practise your php routine become a type of function with parameter and with a sort of template-call you can put it in your code. It's more simple if you seek for smarty in gogle and study from example. I know you must study a new programming style but it will be a good idea. i have solved several type of problem for example i have added external reference at other database or i have modified template to show my data.

Hi just wondering being new to Cubecart where do I need to look to start adding some external php/java/ajax code to and existing document in the main content page>

I have created a document in the admin panel for partner searches, which will use a store locator postcode search with geocoding, do I need to create a separate .php file or can I add the code for the external web app straight to the page editor using the source option in the editor?

Any help would be useful.

Link to comment
Share on other sites

Guest kieranbarnes

Your question has two answers...

You need to edit skins/your-theme/templates/main.php

1. Adding JS is easy. Just paste the code in surrounded by {literal} {/literal}

2. PHP code is similar but has an extra step, see http://bloke.org/php/snippet-allow-php-in-smarty-cubecart-5/

Link to comment
Share on other sites

Guest Dazmanjunket

To john323232 - You say I must study Smarty, can you be more specific on what version to study? As i believe there is a version 2 and a version 3 and there are significant changes made.

Thank you kieranbarnes for the info and link.

Link to comment
Share on other sites

To john323232 - You say I must study Smarty, can you be more specific on what version to study? As i believe there is a version 2 and a version 3 and there are significant changes made.

Thank you kieranbarnes for the info and link.

CubeCart V5 uses Smarty version 3.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...