Skip to content

Instantly share code, notes, and snippets.

@cscartjp
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cscartjp/0e5b7525a12fe6e23fed to your computer and use it in GitHub Desktop.
Save cscartjp/0e5b7525a12fe6e23fed to your computer and use it in GitHub Desktop.
CS-Cart Advanced Add-on Tutorial
<?php
/***************************************************************************
* *
* (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev *
* *
* This is commercial software, only users who have purchased a valid *
* license and accept to the terms of the License Agreement can install *
* and use this program. *
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) { die('Access denied'); }
//データベースからデータを取得
$viewed_categories = db_get_array('SELECT * FROM ?:advanced_addon_data');
if (!empty($viewed_categories)) {
foreach ($viewed_categories as $key => $category_data) {
$category_data['user_name'] = fn_get_user_name($category_data['user_id']);
$category_data['categories'] = unserialize($category_data['categories']);
$category_data['categories'] = fn_get_category_name(array_keys($category_data['categories']));
$viewed_categories[$key] = $category_data;
}
//VIEWにデータを渡す(VIEWでは$viewed_categoriesという変数名で利用可能)
Registry::get('view')->assign('viewed_categories', $viewed_categories);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment