Jump to content

 

tbirnseth

Member Since 08 Nov 2008
Offline Last Active Yesterday, 07:33 PM
*****

Posts I've Made

In Topic: Include Php Code The Retrieve Date From Sql Into Cs-Cart Page

Yesterday, 07:37 PM

The "best practices" way of doing it would be to have your controller do the query and then have it put the results in a smarty variable and use it within the templates.

 

I.e.:

app/addons/my_changes/controllers/frontend/get_info.php containing:

<?php
if( !defined('BOOTSTRAP') ) die('Access denied');
use Tygh\Registry;
switch($mode) {
  case 'verify_user':
    $data = my_function_get_remote_data();
    Tygh::$app['view']->assign('u_data', $data);
    return array(CONTROLLER_STATUS_OK);
}
die( "Unknown mode '$mode'");
 
This will call the template in design/themes/[YOUR THEME]/templates/addons/my_changes/verify_user.tpl  You would then reference your data there via:
{$data.my_field}
 
Strongly suggest you read the developer's guide at https://docs.cs-cart...dons/index.html

In Topic: Question About Rebuild Cache Automatically

09 December 2018 - 10:22 PM

It does make debugging a little easier.  But unique naming of identifiers can also help.  Using a browser inspector, you should be able to do your debugging within the inspector and do your experimental changes within the inspector too.

 

CSS was combined because Google penalizes you if they're not.


In Topic: Include Php Code The Retrieve Date From Sql Into Cs-Cart Page

09 December 2018 - 10:19 PM

Not clear what you're trying to do here.  It looks like you're retrieving a first/last name from another DB, then echoing the one id you've searched for as a table with a single row.

 

What is the problem you're trying to solve?  My guess is there is a much easier way.


In Topic: Shogun Page Builder Alternative For Cs-Cart?

09 December 2018 - 10:11 PM

You can embed whatever css you want. But if you want to use cs-cart editors and data management, then doing so would have to be conditionally done.  Ideally it should be done as a block so any css changes you do are constrained to that block and won't affect the footer or other areas of the site layout.

 

I am not aware of any design eidtor that is integrated to work WITHIN cs-cart.


In Topic: Shogun Page Builder Alternative For Cs-Cart?

07 December 2018 - 07:18 PM

Then I'd just use whatever tool you prefer and create static pages with links to your cs-cart products/categories.

Put them in a 'landing-pages' subdirectory to the root of your store.

 

Then for each page, do the following in phpMyAdmin (using company_id=1 and page name is 'mypage'

INSERT INTO cscart_seo_redirects (src, dest, type, company_id, lang_code) DATA '/mypage.html', '/landing-pages/mypage.html', 's', 1, 'en)

UNTESTED

 

Then yoursite.com/mypage.html

should redirect to yoursite.com/landing-pages/mypage.html

 

I'm not sure if it maintains the original URI or not.  I.e. when it does redirect whether the address bar changes to the 'landing-pages' subdirectory.