Magento tranjectional mail with variable by template id
/0 Comments/in Uncategorized /by puneetk00Magento Group product configrable product assign prices
/0 Comments/in Uncategorized /by puneetk00comment out lines 104-106 of /skin/frontend/base/default/js/scp_product_extension.js. However this may affect how SCP operates.
so this code:
Product.Config.prototype.updateFormProductId = function(productId){
if (!productId)
{ return false; }
var currentAction = $(‘product_addtocart_form’).action;
newcurrentAction = currentAction.sub(/product/d+//, ‘product/’ + productId + ‘/’);
$(‘product_addtocart_form’).action = newcurrentAction;
$(‘product_addtocart_form’).product.value = productId;
};
looks like this:
Product.Config.prototype.updateFormProductId = function(productId){
if (!productId) { return false; }
var currentAction = $(‘product_addtocart_form’).action;
//newcurrentAction = currentAction.sub(/product/d+//, ‘product/’ + productId + ‘/’);
//$(‘product_addtocart_form’).action = newcurrentAction;
//$(‘product_addtocart_form’).product.value = productId;
};
How to remove decimal price in magento
/0 Comments/in Uncategorized /by puneetk00- Open code/core/Mage/Directory/Model/Currency.php
- Find the following :-
return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
on line no 194
return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);
magento how to add new attribute for all product manualy by php code
/0 Comments/in Uncategorized /by puneetk00this below link given by Raghuvendera this is really help full
http://www.webcenter.co.in/how-to-add-custom-fields-for-order-line-items-in-magento
How to add custom fields for Order Line Items with price in magento
/0 Comments/in Uncategorized /by puneetk00Use
this url to add to cart: Ex:
http://192.168.1.9/sspc_test/SSPC1900/checkout/cart/add/?product=196&qty=2&training_location=California
1. checkout_cart_item_default.phtml:::
Add the following below product name
<dl class=”item-options Kiran” id=”checkout_cart_item_default”>
<dt>Training Location</dt>
<dd><?php echo $_item->getTrainingLocation(); ?></dd>
</dl>
2. Table: sales_flat_quote_item
Add field: training_location
3. Product Detailed Page: Add training_location text field as input
4. Code -> Core -> Mage -> Sales -> Model -> Quote.php
Find: public function addItem(Mage_Sales_Model_Quote_Item $item)
Add: $item->setTrainingLocation($_REQUEST[‘training_location’]);
Befoe: $item->setQuote($this);
—————
5. Table: sales_flat_order_item
Add field: training_location
6. XML: code_core_mage_sales_etc_config.xml
ADD: <training_location><to_order_item>*</to_order_item></training_location>
Between: <sales_convert_quote_item> and </sales_convert_quote_item>
Also Add:
<training_location><to_quote_item>*</to_quote_item><to_invoice_item>*</to_invoice_item><to_shipment_item>*</to_shipment_item><to_cm_item>*</to_
cm_item></training_location>
Between: <sales_convert_order_item> and </sales_convert_order_item>
—— Show The Info In Various Locations ——
To show in admin orders area
7. app_design_adminHTML_default_default_template_sales_order_view_items_renderer_default.phtml
Add:
<?php if($_item->getTrainingLocation()): ?>
<?php echo “<strong>Training Location:</strong> “.$_item->getTrainingLocation(); ?>
<?php endif; ?>
Below: <?php echo $this->getColumnHtml($_item, ‘name’) ?>
8. To Show in Checkout/Order review Page
frontend_template_checkout_onepage_review_item.phtml
Add: <?php if ($_item->getTrainingLocation()):?>
<dl class=”item-options Kiran” id=”checkout_cart_item_default”>
<dt>Training Location</dt>
<dd><?php echo $_item->getTrainingLocation(); ?></dd>
</dl>
<?php endif; ?>
Below: <h3 class=”product-name”><?php echo $this->htmlEscape($this->getProductName()) ?></h3>
9. To show in Myorders view page
frontend_template_sales_order_items_renderer_default.phtml
Add: <?php if ($_item->getTrainingLocation()):?>
<dl class=”item-options Kiran” id=”checkout_cart_item_default”>
<dt>Training Location</dt>
<dd><?php echo $_item->getTrainingLocation(); ?></dd>
</dl>
<?php endif; ?>
Below: <h3 class=”product-name”><?php echo $this->htmlEscape($_item->getName()) ?></h3>
10.
######################################
Usefull Links:
http://www.magentocommerce.com/boards/viewthread/19344/
http://magentocoder.jigneshpatel.co.in/add-to-cart-with-custom-attributes-values/
Use like below in product view page
<input type=”text”title=”Qty” value=”My Test Location” maxlength=”12″ id=”training_location” name=”training_location”>
please let me know how can i add also price with this attribute thanx advance
Adding order item to orders grid in Magento
/0 Comments/in Uncategorized /by puneetk00Adding order item to orders grid in Magento
public function __construct()
{
parent::__construct();
$this->setId(‘sales_order_grid’);
$this->setUseAjax(true);
$this->setDefaultSort(‘created_at’);
$this->setDefaultDir(‘DESC’);
$this->setSaveParametersInSession(true);
}
/**
* Retrieve collection class
*
* @return string
*/
protected function _getCollectionClass()
{
return ‘sales/order_grid_collection’;
}
protected function _prepareCollection()
{
$userArray = Mage::getSingleton(‘admin/session’)->getData();
$user = Mage::getSingleton(‘admin/session’);
$userId = $user->getUser()->getUserId();
$connection = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’);
$sql = “Select * from sales_flat_order_grid as sss, junaidbhura_jbmarketplace_products as vitem, sales_flat_order_item as item WHERE vitem.product_id = item.product_id and sss.entity_id = item.order_id and vitem.user_id = $userId”;
$rows = $connection->fetchAll($sql); //fetchRow($sql), fetchOne($sql),…
//Zend_Debug::dump($rows);
$pk = 0;
foreach($rows as $value){
$pkorder[] = $rows[$pk][‘order_id’];
$pk++;
}
//print_r( $pkorder);
//print_r($userId);
//die;
$collection = Mage::getResourceModel($this->_getCollectionClass());
if($userId == 1 ){ }else{
$collection->addFieldToFilter(‘entity_id’, array(‘in’ => array( $pkorder )));
}
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn(‘real_order_id’, array(
‘header’=> Mage::helper(‘sales’)->__(‘Order #’),
‘width’ => ’80px’,
‘type’ => ‘text’,
‘index’ => ‘increment_id’,
));
if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn(‘store_id’, array(
‘header’ => Mage::helper(‘sales’)->__(‘Purchased From (Store)’),
‘index’ => ‘store_id’,
‘type’ => ‘store’,
‘store_view’=> true,
‘display_deleted’ => true,
));
}
$this->addColumn(‘created_at’, array(
‘header’ => Mage::helper(‘sales’)->__(‘Purchased On’),
‘index’ => ‘created_at’,
‘type’ => ‘datetime’,
‘width’ => ‘100px’,
));
$this->addColumn(‘billing_name’, array(
‘header’ => Mage::helper(‘sales’)->__(‘Bill to Name’),
‘index’ => ‘billing_name’,
));
$this->addColumn(‘shipping_name’, array(
‘header’ => Mage::helper(‘sales’)->__(‘Ship to Name’),
‘index’ => ‘shipping_name’,
));
$this->addColumn(‘base_grand_total’, array(
‘header’ => Mage::helper(‘sales’)->__(‘G.T. (Base)’),
‘index’ => ‘base_grand_total’,
‘type’ => ‘currency’,
‘currency’ => ‘base_currency_code’,
));
$this->addColumn(‘grand_total’, array(
‘header’ => Mage::helper(‘sales’)->__(‘G.T. (Purchased)’),
‘index’ => ‘grand_total’,
‘type’ => ‘currency’,
‘currency’ => ‘order_currency_code’,
));
$this->addColumn(‘status’, array(
‘header’ => Mage::helper(‘sales’)->__(‘Status’),
‘index’ => ‘status’,
‘type’ => ‘options’,
‘width’ => ’70px’,
‘options’ => Mage::getSingleton(‘sales/order_config’)->getStatuses(),
));
if (Mage::getSingleton(‘admin/session’)->isAllowed(‘sales/order/actions/view’)) {
$this->addColumn(‘action’,
array(
‘header’ => Mage::helper(‘sales’)->__(‘Action’),
‘width’ => ’50px’,
‘type’ => ‘action’,
‘getter’ => ‘getId’,
‘actions’ => array(
array(
‘caption’ => Mage::helper(‘sales’)->__(‘View’),
‘url’ => array(‘base’=>’*/sales_order/view’),
‘field’ => ‘order_id’
)
),
‘filter’ => false,
‘sortable’ => false,
‘index’ => ‘stores’,
‘is_system’ => true,
));
}
$this->addRssList(‘rss/order/new’, Mage::helper(‘sales’)->__(‘New Order RSS’));
$this->addExportType(‘*/*/exportCsv’, Mage::helper(‘sales’)->__(‘CSV’));
$this->addExportType(‘*/*/exportExcel’, Mage::helper(‘sales’)->__(‘Excel XML’));
return parent::_prepareColumns();
}
protected function _prepareMassaction()
{
$this->setMassactionIdField(‘entity_id’);
$this->getMassactionBlock()->setFormFieldName(‘order_ids’);
$this->getMassactionBlock()->setUseSelectAll(false);
if (Mage::getSingleton(‘admin/session’)->isAllowed(‘sales/order/actions/cancel’)) {
$this->getMassactionBlock()->addItem(‘cancel_order’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Cancel’),
‘url’ => $this->getUrl(‘*/sales_order/massCancel’),
));
}
if (Mage::getSingleton(‘admin/session’)->isAllowed(‘sales/order/actions/hold’)) {
$this->getMassactionBlock()->addItem(‘hold_order’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Hold’),
‘url’ => $this->getUrl(‘*/sales_order/massHold’),
));
}
if (Mage::getSingleton(‘admin/session’)->isAllowed(‘sales/order/actions/unhold’)) {
$this->getMassactionBlock()->addItem(‘unhold_order’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Unhold’),
‘url’ => $this->getUrl(‘*/sales_order/massUnhold’),
));
}
$this->getMassactionBlock()->addItem(‘pdfinvoices_order’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Print Invoices’),
‘url’ => $this->getUrl(‘*/sales_order/pdfinvoices’),
));
$this->getMassactionBlock()->addItem(‘pdfshipments_order’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Print Packingslips’),
‘url’ => $this->getUrl(‘*/sales_order/pdfshipments’),
));
$this->getMassactionBlock()->addItem(‘pdfcreditmemos_order’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Print Credit Memos’),
‘url’ => $this->getUrl(‘*/sales_order/pdfcreditmemos’),
));
$this->getMassactionBlock()->addItem(‘pdfdocs_order’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Print All’),
‘url’ => $this->getUrl(‘*/sales_order/pdfdocs’),
));
$this->getMassactionBlock()->addItem(‘print_shipping_label’, array(
‘label’=> Mage::helper(‘sales’)->__(‘Print Shipping Labels’),
‘url’ => $this->getUrl(‘*/sales_order_shipment/massPrintShippingLabel’),
));
return $this;
}
public function getRowUrl($row)
{
if (Mage::getSingleton(‘admin/session’)->isAllowed(‘sales/order/actions/view’)) {
return $this->getUrl(‘*/sales_order/view’, array(‘order_id’ => $row->getId()));
}
return false;
}
public function getGridUrl()
{
return $this->getUrl(‘*/*/grid’, array(‘_current’=>true));
}
}
how to add new filter magento admin order filter by country
/0 Comments/in Uncategorized /by puneetk00please give me php code for magento
C:xampphtdocsmappcodelocalPkmoduleRewardBlockAdminhtmlRewardGrid.php
protected function _prepareCollection()
{
$collection = Mage::getModel(“reward/reward”)->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$groups = array(“value”,”puneet”,”kumar”);
$this->addColumn(“id”, array(
“header” => Mage::helper(“reward”)->__(“ID”),
“align” =>”right”,
“width” => “50px”,
“type” => “number”,
“index” => “id”,
));
$this->addColumn(“name”, array(
“header” => Mage::helper(“reward”)->__(“NAME”),
“align” =>”left”,
“width” => “50px”,
“type” => “options”,
‘options’ => $groups,
“index” => “name”,
));
$this->addColumn(“order”, array(
“header” => Mage::helper(“reward”)->__(“order”),
“align” =>”left”,
“width” => “50px”,
“type” => “options”,
‘options’ => $groups,
“index” => “order”,
));
$this->addRssList(‘reward/adminhtml_rss_rss/reward’, Mage::helper(‘reward’)->__(‘RSS’));
$this->addExportType(‘*/*/exportCsv’, Mage::helper(‘sales’)->__(‘CSV’));
$this->addExportType(‘*/*/exportExcel’, Mage::helper(‘sales’)->__(‘Excel’));
return parent::_prepareColumns();
}
public function getRowUrl($row)
{
return $this->getUrl(“*/*/edit”, array(“id” => $row->getId()));
}
protected function _prepareMassaction()
{
$this->setMassactionIdField(‘id’);
$this->getMassactionBlock()->setFormFieldName(‘ids’);
$this->getMassactionBlock()->setUseSelectAll(true);
$this->getMassactionBlock()->addItem(‘remove_reward’, array(
‘label’=> Mage::helper(‘reward’)->__(‘Remove Reward’),
‘url’ => $this->getUrl(‘*/adminhtml_reward/massRemove’),
‘confirm’ => Mage::helper(‘reward’)->__(‘Are you sure?’)
));
return $this;
}
}
magen i add new $this->addColumn for filter but value not showing ?
How do i call .phtml block at specfic page in magento?
/0 Comments/in Uncategorized /by puneetk00{{block type='core/template' name='Test' template='goodtest/test.phtml'}}
and this below code is for php file
Connect With Us
Whatsapp : 9891472590
Contact
K2/25, Harijan Colony,
Sangam Vihar, New Delhi 110080
+91 9891472590
mg2dev@gmail.com
Product
Magento 2
WordPress
Shopify
SEO
SMO