Update htaccess to include rewrite rules for non-existing files and directories
This commit is contained in:
@@ -65,18 +65,18 @@ class Layouts
|
||||
|
||||
if ( !$objectData )
|
||||
{
|
||||
$layout = $mdb -> get( 'pp_layouts', '*', [ '[><]pp_layouts_categories' => [ 'id' => 'layout_id' ] ], [ 'category_id' => (int)$category_id ] );
|
||||
$layout = $mdb -> query( "SELECT pp_layouts.* FROM pp_layouts JOIN pp_layouts_categories ON pp_layouts.id = pp_layouts_categories.layout_id WHERE pp_layouts_categories.category_id = " . (int)$category_id ) -> fetchAll( \PDO::FETCH_ASSOC );
|
||||
if ( !$layout )
|
||||
$layout = $mdb -> get( 'pp_layouts', '*', [ 'categories_default' => 1 ] );
|
||||
|
||||
$cacheHandler -> set( $cacheKey, $layout );
|
||||
$cacheHandler -> set( $cacheKey, $layout[0] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return unserialize( $objectData );
|
||||
}
|
||||
|
||||
return $layout;
|
||||
return $layout[0];
|
||||
}
|
||||
|
||||
static public function active_layout( $page_id )
|
||||
|
||||
@@ -248,11 +248,6 @@ class ShopProduct
|
||||
if ( is_array( $results ) )
|
||||
foreach ( $results as $row )
|
||||
{
|
||||
$row[ 'require' ] = $mdb -> get( 'pp_shop_attributes',
|
||||
'required',
|
||||
[ 'id' => $row[ 'attribute_id' ] ]
|
||||
);
|
||||
|
||||
$row[ 'type' ] = $mdb -> get( 'pp_shop_attributes',
|
||||
'type',
|
||||
[ 'id' => $row[ 'attribute_id' ] ]
|
||||
@@ -301,9 +296,9 @@ class ShopProduct
|
||||
|
||||
$product[ 'products_related' ] = $mdb -> select( 'pp_shop_products_related', 'product_related_id', [ 'product_id' => (int)$product_id ] );
|
||||
|
||||
$products_sets_1 = $mdb -> select( 'pp_shop_products_sets', 'product_sets_id', [ 'product_id' => (int)$product_id ] );
|
||||
$products_sets_2 = $mdb -> select( 'pp_shop_products_sets', 'product_id', [ 'product_sets_id' => (int)$product_id ] );
|
||||
$products_sets = array_unique( array_merge( $products_sets_1, $products_sets_2 ) );
|
||||
$set_id = $mdb -> select( 'pp_shop_product_sets_products', 'set_id', [ 'product_id' => (int)$product_id ] );
|
||||
$products_sets = $mdb -> select( 'pp_shop_product_sets_products', 'product_id', [ 'set_id' => (int)$set_id ] );
|
||||
$products_sets = array_unique( $products_sets );
|
||||
|
||||
$product[ 'products_sets' ] = $products_sets;
|
||||
|
||||
@@ -338,28 +333,6 @@ class ShopProduct
|
||||
return $mdb -> get( 'pp_shop_products_langs', 'warehouse_message_nonzero', [ 'AND' => [ 'product_id' => $id_product, 'lang_id' => $lang_id ] ] );
|
||||
}
|
||||
|
||||
public static function permutation_quantity( $id_product, $permutation, bool $is_multichoice )
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
if ( !$is_multichoice )
|
||||
return $mdb -> get( 'pp_shop_products_stock', 'quantity', [ 'AND' => [ 'id_product' => $id_product, 'permutation' => 0 ] ] );
|
||||
|
||||
if ( is_array( $permutation ) )
|
||||
{
|
||||
foreach ( $permutation as $key => $val )
|
||||
{
|
||||
$permutation_id .= $val;
|
||||
if ( $val != end( $permutation ) )
|
||||
$permutation_id .= '_';
|
||||
}
|
||||
}
|
||||
else
|
||||
$permutation_id = $permutation;
|
||||
|
||||
return $mdb -> get( 'pp_shop_products_stock', 'quantity', [ 'AND' => [ 'id_product' => $id_product, 'permutation' => $permutation_id ] ] );
|
||||
}
|
||||
|
||||
//TO:DO do usunięcia
|
||||
public static function product_both_price( $product_id )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user