Tutorial by Examples: l

$rootId = Mage::app()->getStore($storeId)->getRootCategoryId(); $categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('*') ->addFieldToFilter('path', array('like'=> "1/$rootId/%")) ->addAttributeToFilter('level', 2...
SET FOREIGN_KEY_CHECKS=0; -- Customers TRUNCATE `customer_address_entity`; TRUNCATE `customer_address_entity_datetime`; TRUNCATE `customer_address_entity_decimal`; TRUNCATE `customer_address_entity_int`; TRUNCATE `customer_address_entity_text`; TRUNCATE `customer_address_entity_varchar`; T...
SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE `catalog_product_bundle_option`; TRUNCATE TABLE `catalog_product_bundle_option_value`; TRUNCATE TABLE `catalog_product_bundle_selection`; TRUNCATE TABLE `catalog_product_entity_datetime`; TRUNCATE TABLE `catalog_product_entity_decimal`; TRUNCATE TAB...
SET FOREIGN_KEY_CHECKS=0; TRUNCATE `sales_payment_transaction`; TRUNCATE `sales_flat_creditmemo`; TRUNCATE `sales_flat_creditmemo_comment`; TRUNCATE `sales_flat_creditmemo_grid`; TRUNCATE `sales_flat_creditmemo_item`; TRUNCATE `sales_flat_order`; TRUNCATE `sales_flat_order_address`; TRUNCA...
SET FOREIGN_KEY_CHECKS=0; TRUNCATE `log_customer`; TRUNCATE `log_visitor`; TRUNCATE `log_visitor_info`; TRUNCATE `log_visitor_online`; TRUNCATE `log_quote`; TRUNCATE `log_summary`; TRUNCATE `log_summary_type`; TRUNCATE `log_url`; TRUNCATE `log_url_info`; TRUNCATE `sendfriend_log`; TRUNC...
{-# LANGUAGE RecordWildCards #-} import Text.XML.Light data Package = Package { pOrderNo :: String , pOrderPos :: String , pBarcode :: String , pNumber :: String } -- | Create XML from a Package instance Node Package where node qn Package {..} = node qn [ un...
A static data member of the class may be fully defined within the class definition if it is declared inline. For example, the following class may be defined in a header. Prior to C++17, it would have been necessary to provide a .cpp file to contain the definition of Foo::num_instances so that it wou...
$isSecure = Mage::app()->getStore()->isCurrentlySecure(); This will return true if the current url is secure.
Custom attribute in sales related tables like: sales_flat_quote, sales_flat_order_item, sales_flat_order, etc table In your installation file sql/some_setup/mysql-install-0.1.0.php: <?php $installer = $this; $installer->startSetup(); $installer->addAttribute('quote', 'custom_field'...
Since a signal handler will be called by the kernel using the C calling convention, we must tell the compiler to use the C calling convention when compiling the function. volatile sig_atomic_t death_signal = 0; extern "C" void cleanup(int signum) { death_signal = signum; } int mai...
A C library header can usually be included into a C++ program, since most declarations are valid in both C and C++. For example, consider the following foo.h: typedef struct Foo { int bar; } Foo; Foo make_foo(int); The definition of make_foo is separately compiled and distributed with the...
This simple function can be used to get value from exactly one field one record query result Public Function getDataScalar(ssql As String) openConnection() Try Dim q As New MySqlCommand q.Connection = db q.CommandText = ssql getDataScalar = q.Execut...
An explicit instantiation definition creates and declares a concrete class, function, or variable from a template, without using it just yet. An explicit instantiation can be referenced from other translation units. This can be used to avoid defining a template in a header file, if it will only be i...
import sys from PyQt4.QtCore import * from PyQt4.QtGui import * def window(): app = QApplication(sys.argv) win = QDialog() b1 = QPushButton(win) b1.setText("Button1") b1.move(50,20) b1.clicked.connect(b1_clicked) b2 = QPushButton(win) b2.setText(&quot...
let col_1 = db.collection('col_1'); let col_2 = db.collection('col_2'); col_1 .aggregate([ { $match: { "_id": 1 } }, { $lookup: { from: "col_2", localField: "id", foreignField: "id", ...
As node.js is often used to build API, proper CORS setting can be a life saver if you want to be able to request the API from different domains. In the exemple, we'll set it up for the wider configuration (authorize all request types from any domain. In your server.js after initializing express: ...
Suppose we want to write a constraint which matches a number, but approximatively. Say, you are supposed to have 95 people in a survey, but 93 or 96 will do as well. We can write a custom constraint of the form: public class AlmostEqualToConstraint : Constraint { readonly int _expected; ...
We're going to integrate the AlmostEqualToConstraint with the fluent NUnit interfaces, specifically the Is one. We'll need to extend the NUnit provided Is and use that throughout our code. public class Is : NUnit.Framework.Is { public static AlmostEqualToConstraint AlmostEqualTo(int expected,...
Users often turn up in a situation when a business process cannot be finished because the user has not entered all the necessary information. An example of this situation is when a user tries to create a drop-ship order with missing customer address. According to UX best practices, the system shou...
Note: Angular CLI versions are under rapid development. This documentation targets for the latest version. Prerequisites To execute and work with the latest version, Angular CLI and the project have dependencies that require node v6.9.0 or higher. Setup Make sure that a node version is insta...

Page 747 of 861