All Questions
27 questions
0
votes
1
answer
41
views
How set value for attribute?
I have this code:
foreach ($skuScope as $sku)
{
$object = Mage::getModel('catalog/product');
$product = $object->loadByAttribute('sku', $sku);
$attributes = $product->getAttributes(...
0
votes
1
answer
556
views
Magento 1.9: Get Product details for a Customer Order
I am trying to get the product_id of each orders that the customer has ordered.
One simple way is to fetch all the orders, and for each order have a loop to get all items for each order. Which will ...
0
votes
3
answers
779
views
custom table left join with catalog/product
I have a custom table called flagged_products which lists flagged products like this:
+-----------+------------+---------------------+
| entity_id | product_id | flagged_on |
+-----------+---...
0
votes
1
answer
790
views
Magento 1.9 join table issue
I'm having an issue with Magento 1.9.2.4 trying to make a join on my collection, here's the problem:
Actually I've got a custom table named product_banner which I'm getting by:
$collection = Mage::...
1
vote
2
answers
1k
views
Update product weight in Magento 1.9.x script
I'm writing a script to update product weight programmatically in magento 1.9.x.
The file contains more than ~50000
When I start script the execution time for 100 records is 20 seconds, then the ...
3
votes
2
answers
2k
views
How can I get collection result "column headers" or "column names" in Magento 1.9x?
How can I get collection result "column headers" or "column names" from query?
Suppose I have $data = Mage::getModel('catalog/product')->getCollection(); and I have some joins with other tables
I ...
0
votes
1
answer
393
views
AddFieldToFilter not working properly?
I have a code to add a list of products to a table in my database, as you can see here.
In my code below, you can see that it shouldn't add the product if id_product's (CODIGO) unique value is ...
0
votes
2
answers
37
views
Picking items from the magento database
I am trying to get the client email from the sales_flat_order table but I am not getting this way
public function getOrderbyemail()
{
$email = Mage::getModel('sales/order')->getCollection()
...
3
votes
2
answers
2k
views
Call to undefined method Collection::getData()
I use (Manthan_Marketplace) extension in my Magento store
I want to add a table to this extension
so create a custom table (photos) in Magento database with name:(manthan_marketplace_photos)
Table ...
1
vote
1
answer
194
views
How SELECT `e`.* is coming in Query while printing collection filter in magento 1.9
$collection = Mage::getModel("customer/customer")->getCollection()
->addAttributeToSelect('firstname')
->addAttributeToFilter('grisk_college_new_id', array('in' =>...
0
votes
0
answers
456
views
How to add another model collection data to an array. [Magento 1.9]
I have response collection $customerData, I have to add referral code of selected customers in the same array,
Model and field of referral code is :
$referCustomer = Mage::getModel('...
0
votes
1
answer
1k
views
process collection after load collection
$categoryid = 43;
$layer = Mage::getModel("catalog/layer");
$category = Mage::getModel("catalog/category")->load($categoryid);
$layer->setCurrentCategory($category);
$attributes = $layer
...
5
votes
2
answers
605
views
convert datatype varchar to in magento collection
i have magento collection
Mage::getResourceModel('customizebundles/customizebundles_collection')
->distinct(true)->addFieldToSelect('validity')
...
2
votes
1
answer
249
views
how to Store Values In Database for Custom Grid Serializer (Customer)?
I am Created Custom Module for Customer Grid Serializer and now I want to Store That Values in Diffrent Table.
Can Any one Help me? Any Kind of help will appreiciated.
My Grid Code : app/code/local/...
8
votes
2
answers
2k
views
Filter a collection by NOT FIND_IN_SET
I need to filter a collection by a negative FIND_IN_SET.
I know I can do this:
$collection->addAttributeToFilter(
'attribute_code',
[['finset' => 4], ['null' => true]]
);
This ...
1
vote
2
answers
396
views
get count magento collection per day and weekly
I have table in magento database
CREATE TABLE `topup` (
`topup_id` bigint(20) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`msisdn` varchar(20) NOT NULL,
`amount` int(11) NOT ...
1
vote
2
answers
3k
views
How to add new column to existing module table? [duplicate]
How can I add a new column to existing Magento core table via install script? (without using pure SQL)
$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn($...
0
votes
2
answers
965
views
Adding a sort to a joinField
Context: we have a project which uses M2E so our client can sell on eBay. For easy reference, we've added custom columns to the product grid in the admin panel so that the eBay item ID is displayed ...
0
votes
1
answer
61
views
How to use SQL in Magento modules
I have the follow SQL that I want to execute from a custom module:
SELECT c2.value
FROM catalog_category_product c1
INNER JOIN catalog_category_entity_varchar c2 ON (c1.category_id = c2.entity_id)
...
2
votes
1
answer
601
views
Incorrect usage of UNION and ORDER BY
public function getStatusLimit($array = array()) {
$this->getSelect()->reset()
->union(
$array
);
return $this;
}
$this->_collection->...
0
votes
3
answers
3k
views
Magento Limiting Collections not working
I am using following code to get collections of my custom created module,
app/code/local/Promocode/Promogenerator/Block/Adminhtml/Promogenerator/Grid.php
<?php
class ...
0
votes
3
answers
3k
views
Collection addAttributeToSelect multiple columns in query
I'm trying something very simple:
$categoryCollection = Mage::getModel('catalog/category')
->getCollection();
$categoryCollection
->addAttributeToSelect('name')
->...
1
vote
1
answer
1k
views
Joining two collection / tables
I have situation
I want to join two tables having some data related to orders.One table contain order id as increment_id and other table contain order id as order_id.I am joining the tables through ...
2
votes
2
answers
655
views
Filter collection with dropdown attribute
I want to hide products on frontend that have attribute brand = branda and brandb. Attributes are dropdown and flat tables are enabled.
Reason is i am importing alot of products and some of those ...
1
vote
2
answers
2k
views
Display sum of Amount corresponding to some column xyz
I had created model donation to save donation information and now i want to display total amount of donation to be shown with all the other field
my table is as follows
---------------------------
...
1
vote
1
answer
1k
views
Join to get thumbnail from sales order item - add column to order grid [duplicate]
I'm trying to use an observer to add the thumbnail path to the sales order grid collection - the purpose of this is to add an extra column to the order grid which displays the sales item images. I've ...
2
votes
1
answer
1k
views
How do I get my Collection to use a different DB connection?
So I have extended a Magento collection to obtain my own collection only I want to use a different DB connection. What I have attempted to do is define the connection in config.xml like so:
<...