This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="menu"> | |
<span class="logo_fortunata"> | |
<?= $this->Html->image('logo_fortunata.png') ?> | |
</span> | |
</div> | |
-- | |
# | |
# CSS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$routes->connect('/:category/:slug', | |
['controller' => 'Products', 'action' => 'view'], | |
['pass' => ['category', 'slug']] | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function view($category = null ,$slug = null) { | |
// call frontend layout | |
$this->layout = 'frontend'; | |
if (! $slug) { | |
$this->Flash->success ( 'Invalid id for Product' ); | |
$this->redirect ( '/products' ); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
setlocale(LC_ALL, 'pt_BR.UTF-8'); | |
echo money_format('%n', h($product->PriceLists['price'])); | |
?> | |
# resultado | |
17,20 R$ | |
# preciso de: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$routes->connect('/:category/:slug', | |
['controller' => 'Products', 'action' => 'view'], | |
['pass' => ['category', 'slug']] | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object(App\Model\Entity\Product) { | |
'new' => false, | |
'accessible' => [ | |
'price_list_id' => true, | |
'category_id' => true, | |
'active' => true, | |
'price_list' => true, | |
'category' => true, | |
'order_lines' => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ajax call | |
function login_acesso_lojista() { | |
var data = jQuery("#acesso_lojista_login").serialize(); | |
jQuery.ajax({ | |
type: "POST", | |
data: data, | |
url: "../users/login", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->autoRender = false; | |
if ($this->request->is('ajax')) { | |
$this->layout = 'ajax'; | |
} else { | |
debug('pobrema'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function login() { | |
$this->autoRender = false; | |
if ($this->request->is('ajax')) { | |
$this->layout = 'ajax'; | |
} else { | |
debug('pobrema'); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an order | |
$newOrder = TableRegistry::get('Orders'); | |
$query = $newOrder->query(); | |
$query->insert(['client_id', 'statuse_id']) | |
->values(['client_id' => $clientId->id, | |
'statuse_id' => 1]) | |
->execute(); |