Jump to content

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

How to add basic custom code and/ or use: <?php include 'http://webpagename.com/file.php'; ?> on the homepage Rate Topic   - - - - -

 
  • MEvans
  • Member
  • Members
  • Join Date: 12-Nov 13
  • 20 posts

Posted 12 November 2013 - 07:28 PM #1

Hi,

I'm trying to incorporate some basic/ custom code in the homepage of the store. For instance, I would like to add my own form or menu bar that have been already coded for another site.

I'm thinking I can isolate that code into a php file and call the file in the store using
<?php include 'http://webpage.com/file.php'; ?>

If I'm working in a regular html page or wordpress site, this is straight forward. How do I get this to work within CS Cart?

When I tried to add this code to a block (html block) it doesn't work. The system (v4) won't recognize php that way. I tried to create and add-on / template... Honestly, this starts the get beyond my understanding and I can't seem to find simply [enough] instructions to guide me.

I've been able to add the 'my_changes' add-on and add some design elements but need to add my own divs and basic code in some areas.

Please help

 
  • zeero6
  • Senior Member
  • Members
  • Join Date: 25-Jan 07
  • 649 posts

Posted 12 November 2013 - 07:45 PM #2

Maybe this will help?

http://forum.cs-cart...__1#entry146434

Version 4.9.3 SP1


 
  • MEvans
  • Member
  • Members
  • Join Date: 12-Nov 13
  • 20 posts

Posted 12 November 2013 - 08:11 PM #3

Maybe this will help?

http://forum.cs-cart...__1#entry146434


Thanks, but this doesn't seem to help/ work. The instructions were to:
For example you put a file named "section_name.tpl" into the /skins/SKINNAME/customer/blocks/wrappers and insert this code. And after that, you have to add a "HTML block" with any content, and set the block wrapper to the section_name wrapper.

I know the file structure has changed and tried to add the .tpl file to the appropriate sections but - the html block doesn't give option to have a wrapper. Not getting how to pull this off.

Anymore insight?

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11302 posts

Posted 13 November 2013 - 07:40 AM #4

You can approach your problem in a variety of ways. Some are more portable than others and some are proper for integrating with cs-cart. I would suggest that you provide template variables to your html via a PHP controller/addon. Then write your html using Smarty template variables to pass the business logic into your page.

You can use template extensions by enabling PHP usage in templates (not recommended) and then using Smarty PHP tags {php}code{/php}.

There's a ton of info on this forum for how to do what you want. Spend some time researching or hire a developer if you have more $$ than time/skill.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 03 November 2015 - 06:46 AM #5

how to access a smarty html block i made in the frontent home page by my addon ?



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

Posted 03 November 2015 - 10:53 AM #6

how to access a smarty html block i made in the frontent home page by my addon ?

 

Put the file to the blocks/static_templates folder of the theme or your module and add block to the Home page layout in the admin panel.


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 руб.