Ecommerce product list hard-coded block
Permalink
I'm trying to hard-code an ecommerce product list block, but I am getting an error:
Fatal error: Call to a member function getBlockID() on a non-object
I'm using
Fatal error: Call to a member function getBlockID() on a non-object
I'm using
$product_list = BlockType::getByHandle('product_list'); $product_list->controller->title = 'Products'; $product_list->controller->data_source = 'products_on_sale'; $product_list->controller->options[show_search_form] = 0; $product_list->controller->options[search_mode] = 'simple'; $product_list->controller->baseSearchPathThis = checked; $product_list->controller->displayField[name]_P = checked; $product_list->controller->displayField[price]_P = checked; $product_list->controller->displayField[discount]_P = checked; $product_list->controller->displayLinkToFullPage = checked; $product_list->controller->displayAddToCart = checked; $procuct_list->controller->addToCart = 'This will add to the cart'; $procuct_list->controller->options[show_products] = checked; $procuct_list->controller->default_order_by = 'prName'; $procuct_list->controller->default_sort_order = 'asc';
Viewing 15 lines of 21 lines. View entire code block.