Jump to content

Edit History

ps8modules

ps8modules

Bonjour.

hook:

public function hookDisplayAdminOrder($params)
{

    $id_order   = (int)Tools::getValue('id_order');

	$sql1 = 'SELECT product_id FROM order_detail WHERE id_order = '.(int)$id_order;
    
    /* change to executeS $data1 = Db::getInstance()->getRow($sql1); */
	$data1 = Db::getInstance()->executeS($sql1);

    /* add product and ali url array */
    $productArray = array();

    /* add to array */
	foreach ($data1 as $d1)	{
        $sql2 = 'SELECT url FROM scrape_ali_info WHERE id_product = '.(int)$d1['product_id'];
		/* change to getValue $data2 = Db::getInstance()->getRow($sql2); */
        $data2 = isset(Db::getInstance()->getValue($sql2)) ? $data2 : '';
        $productArray[] = array('product_id' => $d1['product_id'], 'ali_url' => $data2);
    }

	/* remove $prodid = $data1['product_id']; */
			
    /* change all $this->context->smarty->assign(array(
        'id_product' => $id_product,
        'ali_url'    => $data2['url'],
		'id_order'   => $id_order
    ));*/

    $this->context->smarty->assign(array(
        'products' => $productArray,
		'id_order'   => $id_order
    ))

    return $this->display(__FILE__, 'views/templates/admin/vieworder.tpl');
          
}

 

TPL:

{block name="ali_url"}
    {if isset($products) && $products && isset($id_order) && $id_order}
        order id: {$id_order}
        {foreach from=$products item=product}
            product id: {$product.product_id}
            ali url: {$product.ali_url}
        {/foreach}
    {/if}
{/block}

 

obrazek.thumb.png.30dc3886dc22a4c76d664fa7098bf107.png

ps8modules

ps8modules

hook:

public function hookDisplayAdminOrder($params)
{

    $id_order   = (int)Tools::getValue('id_order');

	$sql1 = 'SELECT product_id FROM order_detail WHERE id_order = '.(int)$id_order;
    
    /* change to executeS $data1 = Db::getInstance()->getRow($sql1); */
	$data1 = Db::getInstance()->executeS($sql1);

    /* add product and ali url array */
    $productArray = array();

    /* add to array */
	foreach ($data1 as $d1)	{
        $sql2 = 'SELECT url FROM scrape_ali_info WHERE id_product = '.(int)$d1['product_id'];
		/* change to getValue $data2 = Db::getInstance()->getRow($sql2); */
        $data2 = isset(Db::getInstance()->getValue($sql2)) ? $data2 : '';
        $productArray[] = array('product_id' => $d1['product_id'], 'ali_url' => $data2);
    }

	/* remove $prodid = $data1['product_id']; */
			
    /* change all $this->context->smarty->assign(array(
        'id_product' => $id_product,
        'ali_url'    => $data2['url'],
		'id_order'   => $id_order
    ));*/

    $this->context->smarty->assign(array(
        'products' => $productArray,
		'id_order'   => $id_order
    ))

    return $this->display(__FILE__, 'views/templates/admin/vieworder.tpl');
          
}

 

TPL:

{block name="ali_url"}
    {if isset($products) && $products && isset($id_order) && $id_order}
        order id: {$id_order}
        {foreach from=$products item=product}
            product id: {$product.product_id}
            ali url: {$product.ali_url}
        {/foreach}
    {/if}
{/block}

 

obrazek.thumb.png.30dc3886dc22a4c76d664fa7098bf107.png

ps8modules

ps8modules

hook:

public function hookDisplayAdminOrder($params)
{

    $id_order   = (int)Tools::getValue('id_order');

	$sql1 = 'SELECT product_id FROM order_detail WHERE id_order = '.(int)$id_order;
    
    /* change to executeS $data1 = Db::getInstance()->getRow($sql1); */
	$data1 = Db::getInstance()->executeS($sql1);

    /* add product and ali url array */
    $productArray = array();

    /* add to array */
	foreach ($data1 as $d1)	{
        $sql2 = 'SELECT url FROM scrape_ali_info WHERE id_product = '.(int)$d1['product_id'];
		/* change to getValue $data2 = Db::getInstance()->getRow($sql2); */
        $data2 = isset(Db::getInstance()->getValue($sql2)) ? $data2 : '';
        $productArray[] = array('product_id' => $d1['product_id'], 'ali_url' => $data2);
    }

	/* remove $prodid = $data1['product_id']; */
			
    /* change all $this->context->smarty->assign(array(
        'id_product' => $id_product,
        'ali_url'    => $data2['url'],
		'id_order'   => $id_order
    ));*/

    $this->context->smarty->assign(array(
        'products' => $productArray,
		'id_order'   => $id_order
    ))

    return $this->display(__FILE__, 'views/templates/admin/vieworder.tpl');
          
}

 

TPL:

{block name="ali_url"}
    {if isset($products) && $products && isset($id_order) && $id_order}
        order id: {$id_order}
        {foreach from=$products item=product}
            product id: {$product.product_id}
            ali url: {$product.ali_url}
        {/foreach}
    {/if}
{/block}

 

ps8modules

ps8modules

hook:

public function hookDisplayAdminOrder($params)
{

    $id_order   = (int)Tools::getValue('id_order');

	$sql1 = 'SELECT product_id FROM order_detail WHERE id_order = '.(int)$id_order;
    
    /* change to executeS $data1 = Db::getInstance()->getRow($sql1); */
	$data1 = Db::getInstance()->executeS($sql1);

    /* add product and ali url array */
    $productArray = array();

    /* add to array */
	foreach ($data1 as $d1)	{
        $sql2 = 'SELECT url FROM scrape_ali_info WHERE id_product = '.(int)$d1['product_id'];
		/* change to getValue $data2 = Db::getInstance()->getRow($sql2); */
        $data2 = Db::getInstance()->getValue($sql2);
        $productArray[] = array('product_id' => $d1['product_id'], 'ali_url' => $data2);
    }

	/* remove $prodid = $data1['product_id']; */
			
    /* change all $this->context->smarty->assign(array(
        'id_product' => $id_product,
        'ali_url'    => $data2['url'],
		'id_order'   => $id_order
    ));*/

    $this->context->smarty->assign(array(
        'products' => $productArray,
		'id_order'   => $id_order
    ))

    return $this->display(__FILE__, 'views/templates/admin/vieworder.tpl');
          
}

 

TPL:

{block name="ali_url"}
    {if isset($products) && $products && isset($id_order) && $id_order}
        order id: {$id_order}
        {foreach from=$products item=product}
            product id: {$product.product_id}
            ali url: {$product.ali_url}
        {/foreach}
    {/if}
{/block}

 

×
×
  • Create New...