PDA

View Full Version : حرفه ای: آموزش نوشت ماژول برای پرستاشاپ



mahdisaraei
دوشنبه 12 مرداد 1394, 21:02 عصر
سلام به همه دوستان .
من در انجام آخرین پروژه ها در PHP هستم و میخام برم سمت جاوا . ولی

واسه پرستاشاپ 1.6 چطور باید ماژول نوشت ؟؟؟
اگه هرکس بلده کمک کنه ......

mahdisaraei
دوشنبه 12 مرداد 1394, 21:43 عصر
خودم در جستجو فارسی به یک نکته ساده رسیدم ولی بهتر از هیچیه ....
لینک آموزش : آموزش ماژول نویسی پرستاشاپ در حد echo (http://ipresta.ir/forum/topic/97-%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D8%B7%D8%B1%D8%A7%D8%AD%DB%8C-%D9%85%D8%A7%DA%98%D9%88%D9%84-%D9%BE%D8%B1%D8%B3%D8%AA%D8%A7-%D8%B4%D8%A7%D9%BE/)

این آموزش کد هاشو ناقص تو سایت گذاشته ... :-(

ولی لینک اصلی (http://www.marghoobsuleman.com/blog/how-to-create-prestashop-modules) رو گذاشته .






<?php
class Fashion extends Module
{
function __construct()
{
$this->name = 'fashion';
$this->tab = 'Blocks';
$this->version = 1.0;

parent::__construct(); // The parent construct is required for translations

$this->page = basename(__FILE__, '.php');
$this->displayName = $this->l('Block Fashion');
$this->description = $this->l('Add a fashion block');
}

function install()
{
if (!parent::install())
return false;
if (!$this->registerHook('leftColumn'))
return false;
return true;
}

/**
* Returns module content
*
* @param array $params Parameters
* @return string Content
*/
function hookLeftColumn($params)
{
return $this->display(__FILE__, 'fashion.tpl');
}

}
?>





<div class="block">
<h4>Fashion</h4>
<div class="block_content" style="padding:0px;">
My First Prestashop module
<a href="http://www.giflelo.com/">
<img src="{$module_dir}fashion.jpg" border="0" />
</a>
</div>
</div>