Merchandising Variables: Unexpected Products - web-analytics

I'm using Evar2 for Internal Campaign IDs. It is set up as a Merchandising Evar
Syntax: 'Conversion Variable Syntax'
Allocation: 'First'
Expiration: 'Purchase'
Binding Events: 'Purchase Event', 'Product View Event', and 'Cart Add Event'
In this particular question, there is an internal campaign that links to a product detail page, where a product view is set. Clicking through on the internal campaign results in this:
Events 'prodView'
products '123456'
eVar2 '7890'
Since the 'Product View Event' occurs on this resulting page, and is one of the binding methods, I would expect this SKU to bind to the value of '7890' in eVar2 and remain so until purchase.
When I run a report on this particular entry (7890) in eVar2 and break it down by Products, with Revenue as a metric, I'm seeing other products being purchased.
I'm okay that maybe SKU 7890 wasn't purchased at all, but I would not expect other products to be present there, because they were never bound to that value for eVar2
Thanks

That could be because you have allocation set to 'First' instead of 'Most recent'.
If someone views SKU 7890, but then also views and purchases SKU 1234, the 1234 purchase will be recorded against 7890 in eVar2 (because it was the 'First' value.)
Check if the eVar is being set anywhere else before the product pages, as First and Most recent allocation still applies.
With First, it won't change until expiration. With Most recent it will keep changing each time a new value is set.
The eVar in conversion syntax will apply to all products (when there are multiple in the products string) at any of the binding events. So, if a visitor views one product, then adds another to their cart, the same 'First' eVar will then apply to both products in the cart.

Related

Magento order_id increment is inconsistent(seems to have jumped one value)

I have noticed that in my Orders grid in the admin, all the(hundreds) of orders have sequential order ids, all but one. I have 100000103 and then 100000105.
The 100000104 is missing. I have checked this post(magento order id increment jumps) on StackOverflow, but the answer there suggests the following:
If you want to find your 'missing' increment_ids, take a look in sales_flat_quote under the field reserved_order_id. You should see them attached to unconverted quote objects (carts).
But I do not have the missing ID in the specified table for the reserved_order_id column. It is also missing from there, the IDs go 103 and then 105..
I have also checked the abandoned carts reports grid, it is empty.
Should I be concerned that there was some error? The shop owner says he is worried that some order is missing or something..
This is normal, take a look # magento order id increment jumps
When Magento enters the checkout process it 'reserves' an increment_id
and places it on the quote (cart) object and if customer change their mind there will be a missing order id.

Get order_id before submiting order in Magento

I have added a custom field in checkout page at shipping method step in magento. I am able to insert data from this field to my custom table mg_cake_message(msg_id,customer_id,cake_msg). I need another attribute (order_id) to show data for respective orders in admin panel. How can i get order_id before submitting an order?
I have searched in google and some of people suggest to use quote_id instead of order_id. Is quote_id is same as order_id ?
If it's not possible to get order_id before submiting order then how can the two previous step(Billing Information, Shipping Information) is managed?
Please make me a response .....
A quote in Magento is basically an order that hasn't been placed yet. It contains product items (shopping cart), addresses and payment/shipping methods. It is created as soon as you add an item to cart and Magento creates a sales/quote object.. During checkout, billing and shipping data is added to the quote. Finally, when the user clicks place order, the quote object is converted to an order sales/order object.

Codeigniter cart - adding item multiple times does not increment qty

Im trying to add some item multiple times to cart, but added item doe's not appear in cart, if its already in it.
Is this normal in CI cart, or I messed up something?
How to workaround this?
I want same item added multiple times, in order to change price on second piece (special offers).
My cart_add function looks like example at codeigniter manual, I think there is no need to include code.
I found in cart class code, that cart row identifier ($rowid) is an md5 checksum generated from id and options. I temporarily added something like this to options array:
'options' => array('rid' => mt_rand(), ...)
but are there better ways? I feel im doing it wrong.
As I know you can't directly add/update the cart multiple times to make it's quantity increased. You need to do cart update by doing loop on cart contents. It's because CI will always create unique row_id on inserted product/item. The reason a unique ID is created is so that identical products with different options can be managed by the cart. For more clear you may refer to this article.
Here you can do to update your cart item:
foreach($this->cart->contents() as $item){
if($item['id'] == 'your_product_id'){
$item['qty'] = 3;
$this->cart->update($item);
}
}

Magento: Show a products immediate categories, not parent or grand-parents and display on different lines

I'm building a store that has proven a little difficult and the client has requested some things that seem like a lot of effort for not much benefit.
They want the product brand, type, name and year all on new lines on catalogue and page views.
I have reasoned that can be achieved through placing the products into brand and type categories (and unfortunately year as well which I'm working to find another solution as this will be a nightmare). These categories are in parent categories called Shop By Brand and Shop By Type.
I'm wanting to echo the immediate categories of the product individually. So echo BRAND and echo TYPE. This is so the order can be BRAND, NAME, TYPE.
To achieve this I need to get the immediate category and not grand-parent category of the product, and echo each individually.
This is unless somebody presents a more elegant solution.
Thanks in advance.
You can do this with attributes. Let's say you add a new attribute, 'Year' (attribute code 'year'). Add that into your attribute set and enter a value.
//display the year
echo $_product->getYear();
The same method can be used for other attributes. There'a already a 'manufacturer' attribute you can use for this, or if you're a stickler for semantics, you can create a new 'brand' attribute and use the same concept (manufacturer and brand are not the same thing to some store owners).
//display the brand
echo $_product->getBrand();

What is the conceptual difference between a Product and a Quote Item

Involved classes : Mage_Sales_Model_Quote_Item and Mage_Catalog_Model_Product.
I get both of them as a result of listening an event ( on cart add ). I am trying to update the quantity information for a product from an external source.
So far I based my code only on the product information and I am not sure if this is correct.
What is the purpose of Quote Items?
How about an bundled of configurable product? Do you have any recommendation on how to get the individual items from a bundle product?
Thanks
I want to thank both responders so far for their effort but their responses are pretty far from my question. I'll try to respond myself based on the things that I've learned.
A quote is a concept related to the order, only that is previous to that in terms of work flow in Magento. A real world concept is something like a preorder, like a postIt on which you place your asked dishes in a restaurant without being an order or a bill.
I was monitoring an event (checkout_cart_product_add_after) that is sending me the $product and the $orderItem. I understand now that is sending both in order to get information about the product and information about billing and the representation of that product in the future order.
In the case of the grouped products for example where the $product is Tshirt with various associated sizes, the $product will contain the SKU of the main grouped product and the $orderItem will contain the instance of the Tshirt that was selected ( medium size SKU ).
FYI: So in order to update the information of a product at cart update you have is better to get the product info from the $item if is a complex type ( bundle, configurable or grouped )
Magento drops quote items into the cart, specifically. Those quote items are retrieved by using $product->prepareForCart. These items also include different information, such as quantity and configurable product options (on a quote item).
From a backend perspective, data for products are stored in: catalog_product_entity_*, whereas quote items are stored in sales_flat_quote_item (at least in Enterprise. someone else might want to verify this on community).
EDIT: Attaching some code that we wrote to import product inventories a while back.
$product = Mage::getModel("catalog/product")->load($productId);
$product->seStockData(array(
"qty" => (int)$yourQuantity,
"is_in_stock" => ((int)$isTheProductInStock),
"manage_stock" => $manageStock,
"is_qty_decimal" => $isQtyDecimal,
"use_config_manage_stock" => $useConfigManageStock,
));
Mage::getModel('catalog/product_api')->update($sku,$product->getData());
For your purposes you may just need to call $product->save();, but I'm including the whole snippet as written because it works.
Hope that helps. Thanks,
Joe
My first answer would be that a product and a quote for a product are two separate entities and therefore should not be modelled in a unified entity.
An example of why would be from the company I work for, and why we model these things separately:
In our e-procurement system you might have a "contract" between a specific buyer and a seller. The "quote" item models this when it comes to invoice entries. If there isn't a contract use the normal product price to create a Quote Item else adjust the price using the "contract" between supplier and buyer.

Resources