texts: How to enable guest checkout for particular store in multi-store site in magento?

texts:
I have two stores in my Magento site. I want to enable guest checkout for one store and the other store should not have guest checkout. How can I do this in Magento 1.8 ?

Any Help Appreciated.


texts: Extract data from database and display it in a form

texts:
I stored some data in database. I want to function my program in such a way that when I click on an edit link whole data gets extracted from database and get displayed on a form.

When I click on 1st row edit button its corresponding data must get displayed in the above form.

The given below is my code for form and table.

<form role="form" action="<?php echo $this->getUrl('test/user_view/save'); ?>" method="post">

  Title
  <input id="title" type="text" name="title" />

  File Name
  <input id="file_name" type="text" name="filename" />

  Content
  <input id="content" type="text" name="content" />

  Status
  <input id="status" type="text" name="status" />

  <input id="add_button" type="submit" value="Add" />

</form>
<form role="form" action="<?php echo $this->getUrl('test/user_view/edit'); ?>" method="post">

   Test_Id
   Title
   File Name
   Content
   Status
   Created Time
   Updated Time
   Edit
   Delete

 <?php
 $model = Mage::getModel('test/test')->getCollection();
 foreach($model as $data)
  {
    echo '
';
    echo ''.$data->getTestId().'	';
    echo ''.$data->getTitle().'	';
    echo ''.$data->getFilename().'	';
    echo ''.$data->getContent().'	';
    echo ''.$data->getStatus().'	';
    echo ''.$data->getCreatedTime().'	';
    echo ''.$data->getUpdateTime().'	';
    ?>
    Edit
    <a href='?id=<?php echo $data->getTestId() ?>'>Delete
    <?php
    echo '
';
   }
 ?>

 </form>


texts:
I got an error

  main.CRITICAL: Broken reference: No element found with ID 'before.body.end'

in the system.log. I didn't use this id in anywhere in my custom theme inherited by Luma.

Why this error came continuously and how to fix this?


texts: How to truncate the name title on related products block magento

texts:
                                <a title="<?= $block->escapeHtml($item->getName()) ?>"
                                   href="<?= $block->escapeUrl($block->getProductUrl($item)) ?>"
                                   class="product-item-link">
                                    <?= $block->escapeHtml($item->getName()) ?>

I'm trying to use substr like this

substr($_helper->productAttribute($_product, $_product->getName() , 'name'),0,75)

But my code does not work correctly, it shows a 504 on product page.

Thanks


texts: Regex to Capture Text Between Rounded Bracket

texts:
Im having trouble to create the regex pattern (javascript) to capture the text between rounded bracket. Hereby the string value:

var pattern = /->__\(([^)]+)\)/g;
var value = "Line 54:'label' => $this->helper('cms')->__('Images (%s)', implode(', ', $labels)),".match(pattern);

I need the output value as below

->__('Images (%s)', implode(', ', $labels))


texts: Displaying ALL products on the home page (New, Featured, Sale basically everything)

texts:
I'm trying to add a product slider at my website's home page. I have tried using almost all the {{block type="catalog/xxxxx"}} but I cannot get it to display ALL PRODUCTS in the home page's content.
I know it's possible to get New products or Featured Products, but having all of them in a single slider doesn't seem to work. I have spent hours now trying to achieve this. Any help would be greatly appreciated!

Note: I have previously been able to achieve this but the code doesn't work anymore!
I'm using Ultimo theme by Rainforest, if it helps!

EDIT:
I've also tried using the below

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

but this causes the HTML code to break and results in the content below the homepage (i.e footer, link etc to disappear).


texts: Is any Products images renderer class Script\QuickView\Helpers\Html is possible in magento 2?

texts:
Hi guys, i am trying to create products quick view here i am facing on
  one issue related to Html class actually which is responsible for
  products image rendering purpose.

  Is any one have any idea please tell me.

Actually i am using this link enter link description here

  Error Code

Fatal error: Uncaught Error: Class 'Script\Base\Helpers\Html' not found in E:\xampp\htdocs\mage\app\code\Script\QuickView\view\frontend\templates\product\view\gallery.phtml:17 Stack trace: #0 E:\xampp\htdocs\mage\vendor\magento\framework\View\TemplateEngine\Php.php(59): include() #1 E:\xampp\htdocs\mage\vendor\magento\framework\View\Element\Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Gallery\Interceptor), 'E:/xampp/htdocs...', Array) #2 E:\xampp\htdocs\mage\generated\code\Magento\Catalog\Block\Product\View\Gallery\Interceptor.php(505): Magento\Framework\View\Element\Template->fetchView('E:/xampp/htdocs...') #3 E:\xampp\htdocs\mage\vendor\magento\framework\View\Element\Template.php(300): Magento\Catalog\Block\Product\View\Gallery\Interceptor->fetchView('E:/xampp/htdocs...') #4 E:\xampp\htdocs\mage\vendor\magento\framework\View\Element\AbstractBlock.php(667): Magento\Framework\View\Element\Template->_toHtml() #5 E:\xampp\htdocs\mage\generated\code\Magen in E:\xampp\htdocs\mage\app\code\Script\QuickView\view\frontend\templates\product\view\gallery.phtml on line 17


texts: Magento 1 on Nginx with PHP 7 - 500 Error - Uncaught Error: Function name must be a string Layout.php:555 Stack trace

texts:
Throwing error while moving Magento 1 website on php 7 configured server.

  Fatal error: Uncaught Error: Function name must be a string in
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Model/Layout.php:555
  Stack trace: #0
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(390):
  Mage_Core_Model_Layout->getOutput() #1
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Cms/Helper/Page.php(137):
  Mage_Core_Controller_Varien_Action->renderLayout() #2
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Cms/Helper/Page.php(52):
  Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController),
  'no-route') #3
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Cms/controllers/IndexController.php(75):
  Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController),
  'no-route') #4
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(418):
  Mage_Cms_IndexController->noRouteAction() #5
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254):
  Mage_Core_Controller_Varien_Action->dispatch('noRoute') #6
  /home/mcs/html/sitem in
  /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Model/Layout.php
  on line 555


texts: Magento 1 shopping cart: product list empty, but there is products

texts:
When I open shopping cart, the product list seems to be empty; however there is products, infact the total show the price. Any suggesion?
Thank youenter image description here
Magento 1.9.4.5


texts: Making attributes assigned to configurable products optional

texts:
Right now when you setup a configurable product, you choose attributes to assign to that configurable product which determine how to relate simple products to it.

I have a situation where there are a lot of simple products to assign to one configurable product, however some configurable attributes need to be optional. The optional configurable attributes would just come last in the sort ordering on the configurable product page. So if the next attribute is not assigned to that associated simple product, it wouldn't show -- only those configurable attributes of those with values would show.


texts: Magento 1.9, Klarna checkout, i can not make an order

texts:
I can not make an order, writes Sorry, the delivery option you chose cannot be processed.
Here are the delivery settings.


texts: Magento 2 : how to configure multiple domain in nginx server

texts:
i have create multiple store view for access the same site using below domain example.

dev.com ( main site )
created two store view for uk and aus.
dev.uk
dev.aus

right now, my domain is not point so i can access this aus and uk website
using below url

dev.com/uk
dev.com/aus

for that i have create two folder in pub/aus and pub/uk
and also add below code.

location /aus {
    root /aus;
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /aus/index.php last;
        break;
    }
}

but my question is what i need to do when i point the domain ? how can i access this /aus and /uk folder and what i need to change ?

Any idea please share.


texts:
I have the following custom payment plugin controller. After purchase, it does not enable a downloadable product. I am wondering if there is a simple line of code I could add so that this controller will also make the downloadable product in the order Available.

//Get data from Gateway postback
$data = $this->getRequest()->getPost();
$orderId = $data['orderid'];

if ($data['reasonForDeclineCode'] == '') {
    // Payment was successful, so update the order's state, send order email and move to the success page
    $order = Mage::getModel('sales/order');
    $order->loadByIncrementId($orderId);
    $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
    $order->setStatus('processing');
    $order->sendNewOrderEmail();
    $order->setEmailSent(true);

    $order->save();

    Mage::getSingleton('checkout/session')->unsQuoteId();

    Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
} else {
    // Payment was declined, so update the order's state, send order email and move to the success page
    $order = Mage::getModel('sales/order');
    $order->loadByIncrementId($orderId);
    $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Gateway has declined the payment.');

    //$order->sendNewOrderEmail();
    //$order->setEmailSent(true);

    $order->save();

    Mage::getSingleton('checkout/session')->unsQuoteId();

    Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failed', array('_secure'=>true));
}

I ended up "solving" the problem by adding the following code to invoice successful orders after $order->setStatus('processing'); and before $order->sendNewOrderEmail(); however now I have a problem where every time an order is placed, the status on previous successful orders once again gets updated with processing and complete. This happens many more times. So far it's just an annoyance and bad for my database but not hurting anything. I will look into it later but if someone has a hint.

//create invoice for the order
$invoice = $order->prepareInvoice()
                ->setTransactionId($order->getId())
                ->addComment("Invoice created by payment processor plugin.")
                ->register()
                ->pay();

$transaction_save = Mage::getModel('core/resource_transaction')
->addObject($invoice)
->addObject($invoice->getOrder());

$transaction_save->save();
//now create shipment
//after creation of shipment, the order auto gets status COMPLETE
$shipment = $order->prepareShipment();
if( $shipment ) {
     $shipment->register();
     $order->setIsInProcess(true);

     $transaction_save = Mage::getModel('core/resource_transaction')
                ->addObject($shipment)
                ->addObject($shipment->getOrder())
                ->save();
}


texts: Admin order update price programmatically in quote loop

texts:
I have a bit of custom pricing that needs to be carried out for each product in an order which alters the end price of the item.

I am using an observer with the sales_quote_item_qty_set_after event to ensure that the price is run each time the product is re-configured, as I haven't been able to get desired results from other events.

The issue i'm running into is the inability to change the price of the product in the quote when looping through the quote using ->getAllItems().

I know that the price can be overridden via the following for the product add events.

$_item = $obs->getQuoteItem();
$_item = ( $_item->getParentItem() ? $_item->getParentItem() : $_item );
$new_price = 1000;
$_item->setCustomPrice($new_price);
$_item->setOriginalCustomPrice($new_price);
$_item->getProduct()->setIsSuperMode(true);

However, I can not find a way to do it when running through the quote items within the cart. Is this possible, or would the pricing have to be done in a different observer, and if so, which?

Full code is below...

public function adminAddProduct(Varien_Event_Observer $obs) {
    $quote = $this->_getSession()->getQuote();
    foreach($quote->getAllItems() as $_item){
        $options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());
        $_product = $_item->getProduct();
        $sku = $options['simple_sku'];
        if ($sku) {
            $tierPrices = $_product->getTierPrice();
            $price = $_item->getPrice();
            $qty = $options['info_buyRequest']['qty'];

            $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
            $runspeed = $product->getResource()->getAttribute('runspeed')->getFrontend()->getValue($product);

            $prodOpts = [];
            foreach($options['options'] as $option) {
                $prodOpts[$option['label']] = $option['value'];
            }

            $index = 0;
            foreach($tierPrices as $tierPrice) {
                if($tierPrice['price_qty'] <= $qty && $tierPrices[$index + 1]['price_qty'] > $qty) {
                    $price = $tierPrice['price'];
                }
                //$prodTiers[$tierPrice['price_qty']] = $tierPrice['price'];
            }

            if($prodOpts['Quantity'] == 'Fixed Quantity' && array_key_exists('Quantity Select', $prodOpts)){
                $qty = str_replace(',', '', explode(" ", $prodOpts['Quantity Select'])[0]);
            } else {
                $qty = 1;
            }

            $_item->setQty($qty);
            $_item->setCustomPrice($customPrice)->setOriginalCustomPrice($customPrice);

            $new_price = 999;

            $_item->setPrice($new_price);
            $_item->setCustomPrice($new_price);
            $_item->setOriginalCustomPrice($new_price);
            $_item->save();

            Mage::log($price);
            Mage::log($prodOpts);
        }
    }
}

Any help is appreciated.


texts: Magento 2 : How to get Product url in custom page

texts:
In my block I have provide a function to fetch product details from product Id. Code in block file

 public function getProductById($pid)
{
    $product = $this->_productRepository->getById($pid);
    return $product->getUrlModel()->getUrl($product);
}

And in .phtml file I have provided

  $returnProdId = $block->getProductById($returnItems['products']);
  print_r($returnProdId);

But the result is not as expected.Result which I am getting is
  http://localhost/magento2/index.php/catalog/product/view/id/1420/s/iris-workout-top-xs-red/

Please help on the same.


texts:
We currently have a strange error on our website. Some productpages are not loaded, the php error that is displayed is:

How can we solve this?

Warning: simplexml_load_string(): Entity: line 136: parser error : Double hyphen within comment: <!-- My Applications
    <customer_account>
        <r  in /app/code/core/Mage/Core/Model/Layout/Update.php on line 450

#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/home/d...', 450, Array)
#1 /app/code/core/Mage/Core/Model/Layout/Update.php(450): simplexml_load_string('getFileLayoutUpdatesXml('frontend', 'theme', 'headtheme', '1')
#3 /app/code/core/Mage/Core/Model/Layout/Update.php(347): Mage_Core_Model_Layout_Update->fetchFileLayoutUpdates()
#4 /app/code/core/Mage/Core/Model/Layout/Update.php(246): Mage_Core_Model_Layout_Update->fetchPackageLayoutUpdates('default')
#5 /app/code/core/Mage/Core/Model/Layout/Update.php(224): Mage_Core_Model_Layout_Update->merge('default')
#6 /app/code/core/Mage/Core/Controller/Varien/Action.php(306): Mage_Core_Model_Layout_Update->load()
#7 /app/code/core/Mage/Cms/Helper/Page.php(109): Mage_Core_Controller_Varien_Action->loadLayoutUpdates()
#8 /app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'no-route')
#9 /app/code/core/Mage/Cms/controllers/IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route')
#10 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->noRouteAction()
#11 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('noRoute')
#12 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#14 /app/Mage.php(683): Mage_Core_Model_App->run(Array)
#15 /index.php(86): Mage::run('', 'store')
#16 {main}


texts: Magento 2.1.2: How to delete element "minicart" from the website to make the print invoice (print.xml)

texts:
when I want to delete a block minicart I have the following error:

Uncaught TypeError: Cannot read property 'captcha' of undefined(…)

and

Uncaught TypeError: Cannot read property 'autocomplete' of undefined(…)

This is my code template (Vendor/theme/Magento_Theme/layout/print.xml)

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="page.wrapper">
        <container name="side.navbar.container" remove="true"/>
    </referenceContainer>
    <referenceBlock name="top.links" remove="true"/>
    <referenceContainer name="footer" remove="true"/>
    <move element="copyright"   destination="footer.grid-container" remove="true"/>
    <move element="minicart"    destination="header-wrapper.grid-container" remove="true"/>
</body>


texts: Magento 2 : admin product edit page custom attribute with customised Ui-Select

texts:
I have created product attribute with input type select below, I have put attribute create code.

$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(Product::ENTITY, 'seller_id', [
            'type'                    => 'int',
            'label'                   => 'Seller',
            'input'                   => 'select',
            'required'                => true,
            'sort_order'              => 1,
            'source'                  => 'Kunj\Seller\Model\Config\Source\Sellers',
            'global'                  => ScopedAttributeInterface::SCOPE_WEBSITE,
            'user_defined'            => true,
            'visible_on_front'        => false,
            'used_in_product_listing' => true,
            'is_used_in_grid'         => true,
            'is_visible_in_grid'      => true,
            'is_filterable_in_grid'   => true,
            'group'                   => 'General'
        ]);

Now, everything is working fine with that attribute, I have attached screenshot.

Now, I want to display without the default option like this.

And option should appear with ajax and options list should be based on search keyword.


texts:
It's quite strange because I got aware of this after a few weeks the site is online, but it looks like group price rules are not working.

If I create one (e.g. product X must have €25 price instead of €29 for group G) I can see the correct price on the catalog: when a user in group G is logged, he sees price at €25, but as he adds the item to the cart, it gets loaded at €29, and so it remains until the end of the process.

What may be wrong?


texts: Magento2 Back End is working fine but front end is not working and showing This page isn’t working error

texts:
I am working on a Magento 2 project, and it was working fine until today, but now when I try to open it, the page is not working.

The following error is coming in error log:

  PHP Fatal error:  Uncaught TypeError: Argument 1 passed to
  Magento\Catalog\Model\ResourceModel\Product\Collection::addIsSaleableAttributeToFilter()
  must be of the type array or null, integer given, called in
  /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php
  on line 1582 and defined in
  /home/olfwmbaph2hf/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:2475

can someone help to resolve this issue as soon as possible


texts: Magento 2.2.4 ,how to show 3 products per row insteadd of 4 on category list page?

texts: Magento 2 , how to show 3 products per row instead of 4 on category list page?


texts: add carrier name in dropdown same as Fedex and etc

texts:
Want to add the carrier name in dropdown same as default carriers in shipment admin panel, how can I set it ?

Please see picture


texts:
I have been running into problem after problem with the CSV export/import functions. My currently problem is that I cannot seem to assign 'image', 'small_image', and 'thumbnail' attributes to any image path.

This even fails:
I manually change the image, small_image, and thumbnail of a product to one of the images associated with the product, and save.
I export my product CSV.
I check to see if those attribute fields are filled in for that product, and they are.
I import the CSV using the CSV import tool, using the 'Replace Existing Complex Data'.
I check the product that I changed, and it is now not showing any assignment for image, small_image, or thumbnail.

If my understanding is correct, a CSV that is exported and unchanged should be importable to yield the exact same product data, yes? What's going on here?


texts: I want to Display custom Price Under price in mini-cart

texts: I want to display price like show in image.i want display 10% of price in mini cart under price please help me.


texts: The requirement is to redirect to 404 page when data passed on URL query string is not correct. So in the controller, I get the data from URL and check if it is correct, it can proceed. And What should I do when it is incorrect, it should redirect to 404 page?


texts:
I have a magento 2.1.4 site. My client has admin access
Today he exported all clients to an XLS file.

Something happened and all customers are gone...
How is this even possible, even customers with orders...

Is there any log of deletes ?
I suspect this was some kind of user error... How can i be certain ?
Thanks


texts: Cannot download from magentocommerce.com with pub and prive keys?

texts:
I cannot seem to download Magento with my keys. Is it me or my account? Or is it a general issue?
https://<pub>:<private>@www.magentocommerce.com/products/downloads/file/Magento-CE-2.4.0.tar.gz

I tried different keys. I also swapped their places just to be sure. But it doesn't seem to work.


texts: Cannot add or update a child row: a foreign key constraint fails when creating product

texts:
I have the following code to create a product, but when I try to do it it throws me this exception:

Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento`.`catalog_product_entity`, CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DE), query was: INSERT INTO `catalog_product_entity` (`entity_type_id`, `sku`, `created_at`, `updated_at`) VALUES (?, ?, '2017-09-11 18:54:40', '2017-09-11 18:54:40')

Here is my code:

$single = $return['response']['diffgrdiffgram']['NewDataSet']['Produtos']['0'];
$category = Mage::getModel('catalog/category');
$products = Mage::getModel('catalog/product');

$attr = Mage::getModel('novapc_allnations/attr')->load(1, 'entity_id');

$attr = array(
$attr->getData('fabricante'),
$attr->getData('part_number'),
$attr->getData('ean'),
$attr->getData('garantia'),
$attr->getData('peso'),
$attr->getData('preco_revenda'),
$attr->getData('preco_sem_st'),
$attr->getData('ncm'),
$attr->getData('largura'),
$attr->getData('altura'),
$attr->getData('profundidade'),
$attr->getData('subst_tributaria'),
$attr->getData('origem_produto'));

$control = Mage::getStoreConfig('allnations/general/id_allnations',
Mage::app()->getStore());
if ($control != 'sku' and $control == 'other') {
    $control =
Mage::getStoreConfig('allnations/general/id_allnations_other', Mage::app()->getStore());
}

    $products->setName($single['DESCRICAO'])
    ->setDescription($single['DESCRTEC'])
    ->setShortDescription($single['DESCRICAO'])
    ->setAvailable($single['DISPONIVEL'])
    ->setStatus($single['ATIVO'])
    ->setSku($single['CODIGO'])
    ->setWebsiteIds(array(1))
    #->setAttributeSetId(9)
    ->setTypeId('simple')
    ->setCreatedAt(strtotime('now'))
    ->setTaxClassId(4)
    ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
    ->setPrice($single['PRECOREVENDA'])
    ->setWeight($single['PESOKG'])
    ->setStockData(array(
        'use_config_manage_stock' => 0,
        'manage_stock' => 1,
        'min_sale_qty' => 1,
        'max_sale_qty' => 5,
        'is_in_stock'  => $single['DISPONIVEL'],
        'qty'          => $single['ESTOQUEDISPONIVEL']
    ));

$products->setData(array(
    $control    => $single['CODIGO'],
    $attr['0']  => $single['FABRICANTE'],
    $attr['1']  => $single['PARTNUMBER'],
    $attr['2']  => $single['EAN'],
    $attr['3']  => $single['GARANTIA'],
    $attr['4']  => $single['PESOKG'],
    $attr['6']  => $single['PRECOSEMST'],
    $attr['7']  => $single['NCM'],
    $attr['8']  => $single['LARGURA'],
    $attr['9']  => $single['ALTURA'],
    $attr['10'] => $single['PROFUNDIDADE'],
    $attr['11'] => $single['SUBSTTRIBUTARIA'],
    $attr['12'] => $single['ORIGEMPRODUTO']
));

$products->setStoreId(2);

# Pega a CATEGORIA e a SUBCATEGORIA
$mainCat = $single['CATEGORIA'];
$subCat = $single['SUBCATEGORIA'];

# Faz uma checagem para ver se a categoria e a sub-categoria são iguais,
# se forem, adiciona somente na principal, se não forem, adiciona nas duas
if ($mainCat == $subCat) {
    $filter = $category->getCollection()
        ->addAttributeToFilter('name', ['eq' => $mainCat])
        ->addAttributeToSelect('*');

    $filter = $filter->getFirstItem();

    $products->setCategoryIds($filter->getId());
} else {
    $filter = $category->getCollection()
       ->addAttributeToFilter('name', ['eq' => $mainCat])
       ->addAttributeToSelect('*');

      $filter = $filter->getFirstItem()
      ->getId();

        $subFilter = $category->getCollection()
            ->addAttributeToFilter('name', ['eq' => $subCat])
            ->addAttributeToSelect('*');

        $subFilter = $subFilter->getFirstItem()->getId();

        $products->setCategoryIds(array($filter, $subFilter));
}


texts:
I added a mass action in my sales->Order grid and i wanna put an action to export the selected commands in CSV file.

I add this function for mass action in app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php

 $this->getMassactionBlock()->addItem(
    'Adminhtml',
    array('label' => $this->__('Export'),
          'url'   => $this->getUrl('Adminhtml/controller/action') //this should be the url where there will be mass operation
    )
);

But i don't know how to create controller action to my custom mass action

Thank you for help


texts: CSS files are not deferring in magento1.9

texts:
Hello I am trying to deferring following CSS using  <params>defer="defer"</params> tag but it is not working. Here is my style sheet which I want to defer:

<action method="addItem"><type>skin_css</type><name>css/infortis/ultra-megamenu/ultra-megamenu.css</name><params>defer="defer"</params></action>

The tool which I am using to check is: https://developers.google.com/speed/pagespeed/insights/?url=

So please let me know the correct way to defer the CSS. However my JS are successfully deferring and asyncing.

Thanks


texts: Cannot display image inserted by WYSIWYG editor

texts:
I created a form on backend and inserted an image into the editor. The image displays properly in the editor. However, the image cannot be displayed on frontend and 404 error is shown on the console. How to solve it? Thank you in advance.

Image tag generated by Magento:

<img alt="" src="{{media url=" wysiwyg="" screen_shot_2015-09-23_at_2.43.13_am.jpg"}}"="">

Error Message:

http://127.0.0.1/magento/index.php/%7B%7Bmedia%20url= Failed to load resource: the server responded with a status of 404 (Not Found)

Update (06-10-2015 12:33):

It seems that the cause of the problem may be wysiwyg configuration.

In the php file where the wysiwyg editor is added, if I change the wysiwyg configuration to the following:

$fieldset->addField('content', 'editor', array(
        ......
        'config'    => Mage::getSingleton('cms/wysiwyg_config')->getConfig()
    ));

The admin panel even cannot find the image insert page and the image inserted before also disappears from the editor. Besides that, the content from WYSIWYG is output by PHP. Will it be the cause?

This is my current wysiwyg configuration:

$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig();
$wysiwygConfig->addData(array(
        'add_variables'             => false,
        'plugins'                   => array(),
        'widget_window_url'         => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/widget/index'),
        'directives_url'            => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive'),
        'directives_url_quoted'     => preg_quote(Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive')),
        'files_browser_window_url'  => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index'),
    ));


texts:
I would like to create a CSV with product default data and also tier price.

Is it possible to use DataFlow ?

In alternative I would like to use a custom script with direct query to DB, can you help me create this query ?


texts: WIll the magento 2 extension works with magento 1?

texts:
The question is straight forward.
I am developing an extension for magento 2. Will it be compatible with magento 1 as well?
Is it wise to develop for magento 2? Or should I develop for magento 1 such that i can cover a wider range of existing magento users?


texts: Magento 2 - Duplicate Cron jobs in cron_schedule table

texts:
I have Magento 2 setup of version 2.2.2.

I have set the cronjobs as per guidelines.

When I check the cron_schedule table I can see multiple duplicate cronjobs entries.
created_at is the same for the same job_code and scheduled_at time is set with a difference of 1 minute as per the below image.

I haven't changed any default configurations in configuration -> Advance -> System -> Cron (Scheduled Tasks).


texts: Created Product with only custom option in rwd?

texts:
I have created simple product with custom options but the option are appearing below the more view images instead of right side of main product image. How to solve that issue ?
This type of issue not coming in configurable product.


texts: Magento 1.9.3 Get Last Order Comment After Event sales_order_status_history_save_after

texts:
I have created my own function which is trigged for the event sales_order_status_history_save_after. What I wanted to do is, when a new comment is added, the system will get the latest order comment, and send it to customer.

I have tried using the following code,

    public function CommentSaveAfter()
    {
            $history = $order->getStatusHistoryCollection()->getFirstItem();
            return $history->getComment();

    }

However, this code only get me the last comment before the new one is added.

See screenshot, the code only get the last comment 4444, not 5555 when I click on "Submit Comment"

How can I get the latest comment when click on Submit Comment with  event sales_order_status_history_save_after ?

This question is not duplicated with Magento event for adding order comment

My problem is I can not get the comment I just added to the order comment, but only the latest comment from status_history. I have already managed to add my own function to the event sales_order_status_history_save_after. So it's different from the other question.


texts:
What is the best way to get available filter in magento 2 REST API.
I want to create Layered navigation using Layered navigation.


texts: Magento 2 : Get Customer Data using knockout js in checkout page

texts: While placing the order if customer is not login and after entering email address if customer is already register with us then i need to display first name of customer with message below the email address input box.


texts: How to secure Magento version control systems

texts:
Magento version control systems such as Git and Subversion store their metadata in hidden folders.
Someone access my directory and mail me. I think I am not protecting my GIT. can anyone tell me how can I do such a setting?


texts: Why auto generated Factories do not extends or implements any classes (interfaces)

texts:
This is more abstract question then specific problem.

Why auto-generated factories in magento do not implements any common interface?

And what bothers me maybe more. Why auto-generated factories doesn't extend each other, so they could be properly passed as arguments.

For example. I have class MagicClass.
Then I make a class class MoreMagicClass extends MagicClass.

By my opinion auto-generated MoreMagicClassFactory should extend MagicClassFactory.

So when i have another class with constructor that looks like this __construct(MagicClassFactory $magicClassFactory), I could pass the childs factory as well.

I would like to make that as a feature request, but I suspects, there is a good reason, why the auto-generated factories does not behave the way i would like to.

So, is there a reason?

EDIT:

I made feature request on Magento official forum.

Factories should extend each other
Factories should implementcommon interface


texts: Swagger not opening in 2.3.5-p1 magento - "\DateTime" parameter type is invalid

texts:
I had a fresh installation of magento 2.3.5-p1.
But the swagger is giving error.
I checked git issues where someone has suggested to disable dotmailer modules.
I did, but still the error remains.


texts: Magento how to place order form box and add to cart button in sidebar

texts:
i want to place "order form box" with add to cart button in my right sidebar of the theme. i tried to edit layout.XML but not lucky to do that.how we can place this to sidebar in every product page. i am working on this page

hi i want place order form in right side bar


texts: Check if Magento cart is empty using Javascript?

texts:
So I need to check if the cart on my magento site is empty or not.
I can do this using php like this:

<?php
    $count = $this->helper('checkout/cart')->getSummaryCount();
    if($count==0){
      echo 'getFormKey() . '" class="btn btn-success ac-button-top add-to-cart">Order';
    } else {
      echo 'getUrl('checkout/cart') .'" class="btn btn-success ac-button-top add-to-cart">CHECKOUT';
    }
?>

However, the problem is that using PHP it will get cached.
So in order for the button to change you'd have to refresh the cache.
So I was wondering if there is any way to do this check in javascript instead of PHP as I can't think of a way to do it?


texts: Set Discount Price in Listing and Detail Page and Show in Cart

texts:
I have a module in which admin can assign discount to any product from backend. The discount would be in percentage. There is a custom listing page where all the products will be listed having discount applied. My Magento version is 1.8

For example:

Product Price = 299
Discount Percent = 20%
Discounted Price = 239.20

I need to do the following:

Show Discounted Price instead of Regular price on listing page for
all the products
Show Discounted Price instead of Regular price on product detail
page
When user add that product, discounted price should be shown in
cart, checkout and elsewhere
Pass discount percent i.e. 20 in hidden value from listing page to my
observer

I have followed few tutorials below but no luck.

http://magentotutorial.org/programmatically-add-product-cart-price-change-magento/
https://stackoverflow.com/questions/22657041/get-a-value-of-a-custom-input-in-magento

Also, $item->getOriginalPrice() does not return anything here on Magento CE 1.8

Moreover, which event to be used in order to get the Quote ID, as I am getting null

checkout_cart_add_product_complete OR

checkout_cart_product_add_after

Please Help.

Thanks.


texts: Retreive and return response from controller in magento2

texts:
I have a problem in which I'm making an AJAX call to a controller. But, I am not able to check whether it is working or not. I also want to return data in response. But, it keeps throwing some errors. Below is my code:

<?php
namespace MyNameSpace\MyModule\Controller\Index;

class Custom {
    protected $request;
    public function __construct(\Magento\Framework\App\Request\Http $request) {
        $this->request = $request;
    }

    public function getPost() {
        return $this->request->getPost();
    }

    public function __execute() {
        echo "success";
    }
}

But I keep receiving some or the other errors, below is my AJAX call and it is working and sending proper data:

$.ajax({
        url : url,
        type : 'post',
        data : data,
        success : function(result) {
            console.log(result);
        },
        error : function(err) {
            console.log("Error : "+JSON.stringify(err));
        }
})


texts: Refreshed all my Magento2 cache and website is down now

texts:
I just used all those functions:

  Flush Magento Cache

  Flush Cache Sm Module

  Flush Catalog Images Cache

  Flush JavaScript/CSS Cache

  Flush Static Files Cache

And refreshed all my files. After that, when I enter my website I recieved this on the front page:

 1 exception(s):
Exception #0 (Exception): Warning: file_put_contents(/var/www/vhosts/ecustock.ro/httpdocs/pub/static/frontend/Sm/lovefashion/ro_RO/css/config_1.css): failed to open stream: No such file or directory in /var/www/vhosts/ecustock.ro/httpdocs/app/design/frontend/Sm/lovefashion/Magento_Theme/templates/html/complie_less.phtml on line 92

with 36 more errors after  that


texts: How to write a superscript Registered ® in product name

texts:
Our customer wants to offer several products which are registered trademarks. We included the (R) sign in the according product names. Unfortunately, they are not shown superscript as the customer wishes them to be. Now we just tried to use the <sup> tags to make the sign superscript. Those HTML tags are removed from the string which leads to no change.

How can we put a superscript ® in the product name?


texts: Moving Magento Blocks Around. Magento 1.7.X

texts:
I am using Magento 1.7.x Community Edition. I have a static block I created called Custom Tab and I wanted to have that appear right below the Additional Information area. Right now it goes like this:

Located on a Product Page in Magento

Product Description Area
Additional Information Area (Called Product Specs, I created additional attributes)
Product Tags Area
And then the Custom Tab Area

You can find there actual site here: http://www.webstertoolbox.com/index.php/products/archilume-collection/e100-series/e100w24v.html

Is there a way to have Custom Tab show right below the Additional Information Area then have Product Tags right below it?

If so can you please describe what pages I have to modify in Magento to have this done?

Thanks


texts: Magento 2: Mocking method, return value not working

texts:
I am trying to learn unit testing. I wrote simple module to get better understanding about mocking. The test should return "Cat" but it return "Dog".

I can not see what is wrong with the code?
In the example code I have two classes, but how should the test be
written. When the getVariable method is inside learningMock class? I have read about partialMocking but...

Simplistic\Learning\Model\learningMock:

class learningMock {
    public function __construct(\Simplistic\Learning\Model\learningHelper $learningHelper) {
        $this->_learningHelper=$learningHelper;
    }

 public function learningMethodReplace(){
     $var="Dog";
     if($this->_learningHelper->getVariable()=="Cat"){
         $var="Cat";
     }
     return $var;
 }

Simplistic\Learning\Model\learningHelper.php:

class learningHelper {

 public function getVariable() {
     return "Cat";
 }

Simplistic\Learning\Test\Unit\Model\learningMockTest:

class mockTest extends \PHPUnit_Framework_TestCase {

    public function setUp() {
    $this->learningHelper = $this->getMockBuilder("\Simplistic\Learning\Model\learningHelper")
            ->setMethods(['getVariable'])
            ->disableOriginalConstructor()
            ->getMock();
    $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
    $this->_learningMock = $objectManager->getObject('Simplistic\Learning\Model\learningMock');
}

public function testLearningClassReplace() {
    $this->learningHelper->expects($this->once())
            ->method('getVariable')
            ->will($this->returnValue('Cat'));
    $this->assertEquals('Cat', $this->_learningMock->learningMethodReplace());
  }
}

EDITED: I have manage to get it working, but I do not understand what is happening in the code. Can anyone please explain me, why it is working now (from Magento point of view)?

Simplistic\Learning\Test\Unit\Model\learningMockTest:

use Simplistic\Learning\Model\learningMock;
class mockTest extends \PHPUnit_Framework_TestCase {

    public function setUp() {
    $this->learningHelper = $this->getMockBuilder("\Simplistic\Learning\Model\learningHelper")
            ->setMethods(['getVariable'])
            ->disableOriginalConstructor()
            ->getMock();
    $this->learning = new learningMock($this->learningHelper);
}

public function testLearningClassReplace() {
    $this->learningHelper->expects($this->once())
            ->method('getVariable')
            ->willReturn('Cat');
    $this->assertEquals("Cat", $this->learning->learningMethodReplace());
  }
}


texts:
Hello is it possible to find my license key for an extension from ftp or ssh?

Which file stores the license key?


texts: Magento 1.9 Shopping cart becoming empty after login from cart page

texts:
I am facing a cart empty problem with my Magento 1.9 When I am visiting a website as a guest user and login in checkout flow then my shopping cart becomes empty in some cases.

I am looking forward to your solutions.


texts:
I can't figure out why magento is not loading my template:

The template is located at app/design/frontend/base/default/template/fekete/Newsletter2Go/customer/account/dashboard/info.phtml

I double checked its existence. It does exist on the server.

I executed these two commands to make sure that the permissions are correct:

find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod 664 {} \;

then I ran

chown -R myuser:www *

from the project root. I also cleared the cache. Nothing happens.

I also removed the content from the template and replaced it by this:

Test Test Test

But nothing shows at all even though the template hints reveal that it should render.

UPDATE:

I found this in the log

  Not valid template file:frontend/base/default/template/fekete/Newsletter2Go/customer/account/dashboard/info.phtml
  Not valid template file:frontend/base/default/template/fekete/Newsletter2Go/showOnAllPages.phtml


texts: Trouble removing pager from toolbar in Magento 2

texts:
Having trouble removing the pager from the category pages within Magento 2. I extended the catalog module and placed the removal reference inside catalog_category_view.xml. This however does not work, any help is appreciated.

<referenceBlock name="product_list_toolbar_pager" remove="true"/>


texts: How to see inside $this object in Magento 2 logger

texts:
How can I see inside the $this object in my logger file using prs logger?

I tried this

\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->info("in getMediaGalleryImages " .json_encode($this));

But this gives me {} every time.

[2019-05-29 10:07:24] report.INFO: in getMediaGalleryImages {} [] []

What's the right method to see inside the $this object in Magento 2 logger.


texts:
I have generated an addtoCartUrl using

\Magento\Catalog\Block\Product\ListProduct

$aux = $this->_listProduct->getAddToCartUrl($product) ."?form_key=". $this->_formKey->getFormKey() . "&qty=1";

It works for logged users but NOT for Guest users

Any idea?


texts:
All I'm trying to do is add a method to an existing js file. Specifically place-order.js, I understand that I need to do something to requirejs and I understand the logic behind it but for the life of me I can't edit it or understand how to change the js file in place with an edited one.

Can anyone save me?


texts: Set Order Of Imported Product Images Using CSV Magento 2.2

texts:
Does anyone know if there is a way to set the order of the images being imported in the additional_images column when running a CSV import?

It's worth noting that 3 of the 5 product images already exist in the system. When running some tests it seems that Magento 2 doesn't import the images in the order that they appear in the  CSV file. See below:

additional_images

"/k/l/klb159.jpg,/k/l/klb159-a.jpg,/k/l/klb159-b.jpg,KLB159-C.jpg,KLB159-D.jpg"

Images C and D currently do not exist in the system.

After running a successful import the images appear in the following order:

PROD1-C.jpg
PROD1.jpg
PROD1-D.jpg
PROD1-A.jpg
PROD1-B.jpg


texts: I need to add 2 fields on My Account Page

texts: How to add two custom fields of customer in magento from database after registration.


texts: How can I optimise the Password hashing method for millions of records?

texts:
I am trying to run a password hash to change user passwords from MD5 to SHA256 following a migration from Magento 1 to Magento 2.

The problem is, I have around 8 million customer records. I have ensured that the hardware is scaled right up, currently using 8 cores and 60gb RAM which is about the limit I can do.

The process starts off ok running about 1000 records in 10 seconds but over time it grinds down to about 1 min per 1000 records.

Based on rough calculations it will take weeks to run which isn't viable for us.

I have also tried to add some filters to the collection so that it runs in batches and checks the hash version before hashing so it doesn't redo previously hashed items.

I was wondering if there are any tips for optimising this core method to ensure it can run in a decent time?

See below for the modified method that I am using:

protected function configure()
{
    $this->setName('customer:hash:upgrade')
        ->setDescription('Upgrade customer\'s hash according to the latest algorithm');

protected function execute(InputInterface $input, OutputInterface $output)
{
    $this->collection = $this->customerCollectionFactory->create();
    $this->collection->addAttributeToSelect('password_hash');
    $this->collection->addAttributeToSelect('entity_id');
    $this->collection->setPageSize(1000);
    $this->collection->getSelect()->where('password_hash NOT LIKE "%0:1"');
    $pages = $this->collection->getLastPageNumber();
    $currentPage = 1;

    echo $this->collection->getPasswordHash();

    do {
        $output->writeln("starting batch of 1000 customers");
        $time_start = microtime(true);
        $this->collection->setCurPage($currentPage);
        $this->collection->load();
        $this->collection->getSelect()->where('password_hash NOT LIKE "%0:1"');
        $customerCollection = $this->collection->getItems();

        /** @var $customer Customer */
         foreach ($customerCollection as $customer) {
            $customer->load($customer->getId());
           if (!$this->encryptor->validateHashVersion($customer->getPasswordHash())) {
                list($hash, $salt, $version) = explode(Encryptor::DELIMITER, $customer->getPasswordHash(), 3);
                if ($version !== '0') {
                    $version .= Encryptor::DELIMITER . Encryptor::HASH_VERSION_LATEST;
                    $customer->setPasswordHash($this->encryptor->getHash($hash, $salt, $version));
                    $customer->save();
                    $output->write(".");
                }
            }
        }
        $output->writeln('last id: '.$customer->getId(). "");
        $currentPage++;
        //clear collection and free memory
        $this->collection->clear();
        $time_end = microtime(true);
        //dividing with 60 will give the execution time in minutes otherwise seconds
        $execution_time = ($time_end - $time_start) / 60;
        $output->writeln("1000 customers comepleted in " . $execution_time . " min");
    }
while ($currentPage <= $pages && ((1000*$currentPage) > $stopLimit || $stopLimit));
    $output->writeln(".");
    $output->writeln("<info>Finished</info>");
}

}


texts:
My client having website in magento where users comes and creates a tshirt online.  On each tshirt creation, there are 6 different images created using code and total 300 to 400 unique designs created per day so almost 24000 images per day. Currently one hdd with 1TB is attached with two EC2 instances.

Now the problem is, client wants option which can scale automatically as 1 TB is also one day will be full.

Is there any system or architecture which can provide auto scalable option. I don't want to use S3 bucket instead of hdd.


texts: How to optimize image here? my site loading can be faster.


texts: Magento 2, How copy and resize image of category atfer upload

texts:
Using Magento 2, Admin, Catalog-Category. I would like make an image which copy and resize after upload category image.

Example:

I upload image name : rest04.jpg
magento will genterate : /pub/media/magestore/storelocator/images/store/gallery/r/e/rest04.jpg
, so I need an image which name "/pub/media/magestore/storelocator/images/store/gallery/size_40_40/r/e/rest04.jpg".


texts: How to hide these 2 element in css / less?

texts: In Magento2 I want to hide the price-notice and the qty-holder from the bundle product page. I want to edit the _custom.less page but not sure what to write in it. Any help would help. Thanks!


texts: How would I go about getting related products configurable options on the product page? I'd like customers to be able to directly add related products to cart without having to go the products page.


texts: Anything in Magento that could cause a Google "cloaking" ban?

texts:
This question is specific to Magento, but as an FYI, here is a link to Google definition of cloaking:  https://support.google.com/webmasters/answer/66355?hl=en

One of our Magento stores has been banned by Google for "cloaking".  We have done a full investigation of our stack and can't seem to find anything specifically that we have done to trigger this ban.  We have absolutely nothing checking specifically for the google bot user agent.  Our site treats Google bot like any other user.

Unfortunately Google is unwilling to tell us exactly we we did to get banned.  Google has told us that a test is to request a page with a normal user agent (chrome for example) and then request the page with a google bot user agent.  Take both of the HTML results and hash them (we are using md5) and compare the strings.  If the strings don't match then the page is "cloaking" (at least that's what we have been told).

Our script identified the following diffs causing our hashes to not match:

Magento FPC related comment tags like this:

<!--{TOPMENU_7642615c1b9a72d412676bd2c56a7e9a}-->
Magento form key tags like this:

<input name="form_key" type="hidden" value="H8ojGUSABI6wsLVP" />

Has anyone else had this issue?

Is there any good way to resolve this?

Thanks!


texts: Magento2: slow loading after change less file

texts:
I'm trying to create new theme. But every time I reload the home page it is going to high CPU loading.

My Settings:
New theme has just one file: /app/design/frontend/Test/default/web/css/source/_extend.less
Magento mode: developer
Front-end development workflow: Server-side less compilation
Grunt: installed and configured.

Activity monitor:

Chrome console:

And only after php bin/magento setup:static-content:deploy the page is loading fast:

Do I need to deploy static content every time I change some css style if I develop new theme?

Thanks in advance!

I have asked also in github issue:
https://github.com/magento/magento2/issues/2731

Here is similar question:
https://github.com/magento/magento2/issues/2924


texts: issue after magento upgrade to 1.9.3, missing theme on firecheckout page

texts:
The problem occurred when i updated magento 1.9.1 to 1.9.3.
The background image in the header and footer are missing. this is how it looks now after upgrade

Could someone help me find away of getting my theme to look right on my checkout page


texts:
I created a shortcode that will fetch the content of a certain page but i am having problems with shortcodes that was inside the page. Basically my goal is to retrieve the page content and execute the shortcode inside of it.

Thanks in advance.

Edits :

On my home page i create tabs. The content for each tabs are generated in CMS >> page.

here's my code :

`<?php
class TL365_Shortcode_Block_Tab extends Mage_Core_Block_Abstract
{
  protected function _toHtml()
  {

$pageIds = $this->getContent();
if( empty( $pageIds )){ return; }

$ids = explode( ",", $pageIds);
$container_id = $this->getContainerId();

$container_id = !empty( $container_id ) ? $container_id : "container_id_".rand(time(),3);
$html ="";
$html .="
";
$html .="
";
$i = 1;
foreach( $ids as $id ){
    $page =   Mage::getModel('cms/page')->load( $id );
    if ($page->getIsActive()){
        $html .="
getTitle()))." level_".$i."'>".$page->getTitle()."
";
    }
    $i++;
}
$html .= "

";
    $html .="
";
$i = 1;
foreach( $ids as $id ){
    $page =   Mage::getModel('cms/page')->load( $id );
    if ($page->getIsActive()){
        $html .="
getTitle()))." level_".$i." tab-content'>".$page->getContent()."
";
    }
    $i++;
}
$html .= "

";
$html ."
";
$html .= "

";
    return $html;

}
}`

here's how i implement it {{block type="tl365_shortcode/tab" content="about-us2,privacy-policy-cookie-restriction-mode,about-us"}}

the output is :

In the actual page of the about us, i inserted an image but instead of displaying it, i get the shortcode. See image below :


texts: Magento 1.9.2.1 SUPEE-7405 admin not working

texts:
I installed the new patch today - SUPEE-7405 via FTP from this site.

https://magentary.com/kb/install-supee-7405-without-ssh/

Now, it looks like my front end store is still working, however when I try to login into the /admin it takes me to the login/password page...  once I login i get an error.

Invalid method Mage_Core_Model_Session::validateFormKey(Array
(
    [0] => y6h9TjgvchV8hCZT
)
)

Trace:
#0 /home/a0cegcom/public_html/app/code/core/Mage/Admin/Model/Observer.php(73): Varien_Object->__call('validateFormKey', Array)
#1 /home/a0cegcom/public_html/app/code/core/Mage/Admin/Model/Observer.php(73): Mage_Core_Model_Session->validateFormKey('y6h9TjgvchV8hCZ...')
#2 /home/a0cegcom/public_html/app/code/core/Mage/Core/Model/App.php(1357): Mage_Admin_Model_Observer->actionPreDispatchAdmin(Object(Varien_Event_Observer))
#3 /home/a0cegcom/public_html/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Admin_Model_Observer), 'actionPreDispat...', Object(Varien_Event_Observer))
#4 /home/a0cegcom/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#5 /home/a0cegcom/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
#6 /home/a0cegcom/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#7 /home/a0cegcom/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#8 /home/a0cegcom/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#9 /home/a0cegcom/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /home/a0cegcom/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#11 /home/a0cegcom/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#12 /home/a0cegcom/public_html/index.php(88): Mage::run('', 'store')
#13 {main}

any ideas? I already cleared my var/cache and var/session with no luck


texts: Magento 2 Tracking information is currently not available using UPS shipping method

texts:
I have installed a shipping tracker module and configured the UPS
shipping method on Magento 2.1.5 demo. The module with the same
tracking id is working in local but not in the demo. I'm getting this
in the debug.log file

[2021-05-21 06:19:38] main.DEBUG: array (
  'request' => '<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>XXXXXXXXXXXXXXXXX</AccessLicenseNumber>
  <UserId>xxxxxxx</UserId>
  <Password>xxxxxxx</Password>
</AccessRequest><?xml version="1.0" ?>
<TrackRequest xml:lang="en-US">
    <Request>
        <RequestAction>Track</RequestAction>
        <RequestOption>activity</RequestOption>
    </Request>
    <TrackingNumber>XXXXXXXXXXXXXXXX</TrackingNumber>
    <IncludeFreight>01</IncludeFreight>
</TrackRequest>',
  'result' => '',
) {"is_exception":false} []

Note that I have replaced the real credentials with XXXXXXXXX.
In the backend, when clicking on track this shipment it shows no tracking details as shown in the below screenshot,

I have also checked on the ups site to track details which are completely fine. Please let me know if anyone has any idea.


texts: Magento 2: Hide empty rows for custom report

texts:
I've created a custom report in the Magento 2 backend.
Everything is working great, but by default the results grid shows "We can't find records for this period" for any days where there's no data.
I don't want to physically add a filter form to the report interface, I just want the "show_empty_rows" filter to be set to 0. Is there a way of doing this in the XML layout file, or failing that in one of the supporting classes?


texts: How to add custom action in customer address grid in backend magento2

texts:
I have added a custom field in customer_address_entity and want to change it's field value on custom button's click which should be in customer edit form.

Action is working properly but there is an issue when we field gets updated then updated data doesn't display in grid by action.


texts: Display configurable options block on customized page

texts:
I am trying to display configurable options in a custom product view page. I have added following code to page but I am getting an error:

Code:

 <?php $_attributes = Mage::helper('core')->decorateArray($_product->getTypeInstance(true)->getConfigurableAttributes($_product));?>
<?php if ($_product->isSaleable() && count($_attributes)):?>

<?php foreach($_attributes as $_attribute): ?>

*<?php echo $_attribute->getLabel() ?>

<dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>

<select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
<option><?php echo $this->__('Select...') ?></option>
</select>

<?php endforeach; ?>

<?php endif;?>

  Error:  TypeError:
  this.config is undefined

  this.taxConfig  = this.config.taxConfig;

I need help in solving this issue.

Thanks in advance.


texts: Event is not firing up after the 2-3 hour long import process

texts:
I again ran into a weird issue. I have registered an observer for an event that is firing up when the Advance data flow profile finishes its execution completely.
I have checked this successfully when i only import 10-20 products at a time but when i comes in real situation importing 5K to 6K products the observer is not calling up at all after finishing the execution.

What I suspect: I am thinking that after this long hour of application run the object is alive in memory :-p just guessing.

I have set the admin session to some higher and checked the admin is not logging out.


texts: How do I view the XML structure of Magento?

texts: As I understand, Magento meshes the layout and config xml into a Simplexml object. Does anyone know where this object gets stored? I want to view the entire xml of Magento so I can find any model rewrites in the system.


texts: Are there any ways to get sql from getModel?

texts:
i have this statement, but it runs very low

list( $parentId ) = Mage::getModel('catalog/product_type_configurable')
                        ->getParentIdsByChild( $product->getId() );

anyone know how to get the sql it ran? i only know use getSelect() in collection, but how about in Model?


texts: AOE Scheduler Instructions (unsure of how to run commands)

texts:
I'm on 1.9.2.1 and am new to development. My new order emails are not sending so I installed AOE Scheduler and I get the error:

No heartbeat task found. Check if cron is configured correctly. (See Instructions)

On the instruction page it gives me these commands:

sudo crontab -u ultima -e

&

* * * * * ! test -e /home/website/public_html/maintenance.flag && /bin/bash /home/website/public_html/scheduler_cron.sh --mode always

* * * * * ! test -e /home/website/public_html/maintenance.flag && /bin/bash /home/website/public_html/scheduler_cron.sh --mode default

I'm not really sure what to do with these, I took a back up of everything and SSH'd in with PuTTY(windows 10).

When I drop the first one in I get the error:

Website is not in the sudoers file.  This incident will be reported.

The second ones give me:

"-bash: access-logs: command not found"

I'm not really sure what else to do? Can anyone help a new to dev guy out?

I only have cpanel/whm access to the hosting server.


texts: Confused with category scope in Magento 2

texts:
I have a Magento store with 3 stores scope (Brazil, USA and Global) and just one root category, but now I have a main category called 'Off Price'. In this category I need to put specific products for Brazil, USA and Global, but, for example, when i remove a product from Brazil a need to let this product in USA and Global, but the products is been removed in all web sites.

What I'm doing wrong?


texts:
I am unable to save product from magento2 admin
Getting below error

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`catalog_product_entity`, CONSTRAINT `CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DELE), query was: UPDATE `catalog_product_entity` SET `attribute_set_id` = ?, `type_id` = ?, `sku` = ?, `has_options` = ?, `required_options` = ?, `created_at` = '2016-03-16 11:32:03', `updated_at` = '2016-09-15 11:48:26' WHERE (`entity_id`=21826)

Please help me to fix this issue


texts: Magento 2.3: $orderData->getShippingAddress() returns null

texts:
I use Magento 2.3
If I want to access in view order page (on my account) shipping address, the result is null.
$orderId  = $block->getOrderId();
$orderData = $block->getOrderDetails($orderId);
$shippingAddress = $orderData->getShippingAddress();

$shippingAddress is null.
If I call $orderData->getBillingAddress(); return the correct address.
I don't understand why.


texts: How to override admin notification toolbar?

texts:
I am currently using a extension and i would like to add some codes to it to override the notification bar that usually shows up under the header. based on my checks, the file that displays this is...

  /design/adminhtml/default/default/template/notification/toolbar.phtml

i tried adding the following code to my extension's layout xml file but it didn't work!

<reference name="notifications">
<action method="setTemplate">
<template>extension-folder/notification/toolbar.phtml</template>
</action>
</reference>

i checked adminnotification.xml file and i realized it had this code:

<layout>
    <default>
        <reference name="notifications">
            <block type="adminhtml/notification_toolbar" name="notification_toolbar" as="notification_toolbar" acl="system/adminnotification/show_toolbar" template="notification/toolbar.phtml" />
        </reference>
        <reference name="notifications">
            <block type="adminhtml/notification_window" name="notification_window" as="notification_window" acl="system/adminnotification/show_toolbar" template="notification/window.phtml" />
        </reference>
    </default>
</layout>

so i decided to copy this section:

<reference name="notifications">
            <block type="adminhtml/notification_toolbar" name="notification_toolbar" as="notification_toolbar" acl="system/adminnotification/show_toolbar" template="notification/toolbar.phtml" />
        </reference>

and paste it in my extension's xml file and modify the template section with my modified template location. This worked, displaying my modified notification toolbar, but somehow was now displaying 2 instances of it and i cant figure out why!

can anyone assist?


texts: What part in the OPC captures json response from the step functions?

texts:
For example the saveBillingAction() function when you click next, an ajax call is made to /checkout/onepage/saveBilling/

What captures this json output?

I created a sidebar with cart data and want to update the shipping cost based on whether or not the user has a shipping cost.


texts: How to override abstactclass methods in magento2?

texts:
I want to override \Magento\ImportExport\Model\Import\Entity\AbstractEntity's method _saveValidatedBunches.

I have tried using preference but it's not working.

Can anyone help me


texts: magento2: How to swap two elements in header

texts:
I am new in magento and I am creating a custom theme for Magento 2.

I try to swap two elements, header wrapper and header content.

Default header:

I'm trying to get this:

I create file frontend/<vendor>/<theme>/Magento_Theme/layout/default.xml, and try swap it with <move element="header.panel" destination="header.container" before="-"/> but it does not work.


texts:
I have a javascript call to this url : https://mysite/admin/admin/export/export/key/b7c4bdb5a1b9f5147f498741adc99/entity/catalog_product/file_format/csv

From this url how can I find where is located the action ?

I already know the 3 part in url...but here seems to be different. Which module I should look into, which action I should search ?

If this can help this is the main dashboard url after login

https://sysite/admin/admin/dashboard/index/key/276e1bbcbff57306/


texts: Magento 1.9 - Overriding CSS files in Multi Site Environment

texts:
I am running Magento 1.9 in a multiple store environment. I am trying to have the exact same design for every store, thus each store uses the same Theme.
However, I need to make some slight changes in the CSS files for a specific store,but at the moment it is not possible because the CSS resources are being shared among each store.
To address this issue, I have duplicated the theme in the following path:

./app/design/frontend/custompackage/customtheme2
./skin/frontend/custompackage/customtheme2

And then from Admin>System>Design, I have told Magento to use customtheme2 to that specific store.
Now I can easily change the CSS file for that store.
My Question: Is this the correct (Standard) Approach to address my need?


texts: Magento 2: How to Send Reset Password Mass Email to Customers Programmatically

texts:
We have migrated 60,000 Customers from Old System to Magento.

Now we have to send them Email for Reset Password.

https://stackoverflow.com/questions/27920153/create-and-send-email-to-customer-reset-password-link-programmatically-in-magento

https://mage2.pro/t/topic/1595/2

I have gone through above links, but it will be for Magento 1.

How to send Reset Password Email Programmatically. Need to use MailChimp for this Mass Email Sending or by GMAIL SMTP?

Need to create Cron Job? Bulk Mail Send Goes to Spam?

This Script is going to run One time only.


texts:
I have an extension installed on my store which sends a notification when new orders are placed, canceled, hold, unhold etc.

When I am saving the order, I get an error saying

  Order saving error: Class Namespace\Module\Observer\OrderCancelled does not exist

But the Class exist as well in my project. I have run the following commands for my projects

1. php bin/magento setup:di:compile

2.php -dmemory_limit=5G bin/magento setup:di:compile

But that wouldn't solve my error.

Kindly help out with this error and how I could solve this. Thank you


texts: Layout XML block rendered twice in Magento skin

texts:
I'm having a bit of trouble with a custom layout block which I'm trying to add to the head.phtml file of my theme. Basically, I'm trying to add extra favicon definitions to the header of my document.

In my local.xml file, I've added the lines:

<default>
    <reference name="head">
        <block type="core/template" name="favicon.extra" as="favicon.extra" template="page/html/head/favicon-extra.phtml" />
    </reference>
</default>

And then inside head.phtml, I'm calling this as a childHtml template as:

<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<?php echo $this->getChildHtml('favicon.extra') ?>

The problem is that the block is rendered twice, in two different spots:

Underneath the other favicons, as per the head.phtml getChildHtml call, and
After the other scripts in the header

The desired outcome is that I only want the first of these two to render.

From what I've read, I think this has to do with that particular block/reference being automatically rendered via the toHtml output - is this correct?

If so, is there a better/correct way to accomplish what I'm trying to do here? Is there another way to remove the second render?

Any help possible is much appreciated.


texts: Magento 1.9 - Custom Input Checkbox Types in Custom Options

texts:
I wanted to add custom Input Checkbox Type in product custom option and I have followed bellow link in order to add the type. This is working fine as default value (always associated/added to the grand total if it is checked or not) not as an optional, like checkboxes behavior.

Tutorial link - http://magento.ikantam.com/qa/custom-input-types-custom-options

Makes it possible to add another custom input type "checkbox" or not?

If yes, then where I will have to make changes in order to work like checkbox?

Thanks!


texts:
in debug.log i see following entries:

[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:      {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["CONFIG"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["LAYOUT_GENERAL_CACHE_TAG"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["BLOCK_HTML"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["COLLECTION_DATA"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["REFLECTION"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["DB_DDL"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["EAV"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["CUSTOMER_NOTIFICATION"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["FPC"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["INTEGRATION"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["INTEGRATION_API_CONFIG"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["TRANSLATE"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:39] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":
["WEBSERVICE"],"mode":"matchingTag"},"is_exception":false} []
[2016-11-11 21:59:46] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_1"},"is_exception":false} []
[2016-11-11 21:59:46] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_2"},"is_exception":false} []
[2016-11-11 21:59:46] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_3"},"is_exception":false} []
[2016-11-11 21:59:46] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"identifier":"DB_PDO_MYSQL_DDL_design_config_grid_flat_4"},"is_exception":false} []

Why cache is invalidate, even i clear and flush cache ?


texts: Custom Router not working with IndexController in the same module

texts:
I have a module with a custom router.
Here's the code:

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\RouterList">
        <arguments>
            <argument name="routerList" xsi:type="array">
                <item name="Module" xsi:type="array">
                    <item name="class" xsi:type="string">Vendor\Module\Controller\Router</item>
                    <item name="disable" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">22</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>

routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="testroute" frontName="testroute">
            <module name="Vendor_Module"/>
        </route>
        <route id="customrouter" frontName="customrouter">
            <module name="Vendor_Module"/>
        </route>
    </router>
</config>

Router.php

<?php

namespace Vendor\Module\Controller;

use Magento\Framework\Controller\ResultFactory;

class Router implements \Magento\Framework\App\RouterInterface
{
    protected $actionFactory;
    protected $_response;

    public function __construct(
        \Magento\Framework\App\ActionFactory $actionFactory,
        \Magento\Framework\App\ResponseInterface $response
    ) {
        $this->actionFactory = $actionFactory;
        $this->_response = $response;
    }

    public function match(\Magento\Framework\App\RequestInterface $request)
    {
        $identifier = trim($request->getPathInfo(), '/');
        if(strpos($identifier, 'customrouter') !== false) {
            $request->setModuleName('testroute')-> //module name
            setControllerName('productlist')-> //controller name
            setActionName('index')-> //action name
            setParam('param', 3); //custom parameters
        } else {
            return false;
        }
        return $this->actionFactory->create(
            'Magento\Framework\App\Action\Forward',
            ['request' => $request]
        );
    }
}

I have a breakpoint in the first line of the match() function:
$identifier = trim($request->getPathInfo(), '/');

but this doesn't get triggered.

Instead the page is being loaded with an empty layout. (No 404 either)

I have a Index Controller in my module as well:
Vendor/Module/Controller/Index/Index.php

If I set a breakpoint in that Controller's execute function, the program stops there when I call my customrouter URL https://storeurl.com/customrouter

Is the Index Controller the problem here because it is being used instead of the Router? Or is the Index Controller just being used because there is another problem with the custom router configuration?

How can I make this work?


texts: Base Image, Small Image, Thumbnail Image radio buttons are not selected after product images CSV import

texts:
I have successfully imported product images using CSV file, but Base Image, Small Image and Thumbnail Image columns in Images tab, are not selected. No Image is selected by default. So product images are not displaying in front end.

I have set _media_is_disabled to 0 and _media_attribute_id to 88.

I have also filled image, small_image, thumbnail, _media_image with the URL's of the images. Images are shown in backend, but the base image, small image, and thumbnail are not selected.

Can someone please help? How can I get those selected after the product images CSV file is imported?

Yes exact same as that post, but i tried all things on that post, it doesn't work


texts: Magento 2 can't get customer details in observer

texts:
I am using observer for after customer save with following event customer_save_after_data_object

I am trying to get the customer id in observer with following script,

 public function execute(\Magento\Framework\Event\Observer $observer){
    //Do your stuff here!
    echo "<pre>";
    $event = $observer->getEvent();
    $customer = $event->getCustomer();
    print_r($customer);
    die('Observer Is called!');
}

Here i can see die result but am't able to customer data


texts: migration from magento 1.9 to magento 2.0.2 using composer

texts:
I'm trying to download magento2 from git using composer I always see this warning
about Xdebug I uncomment the line zend_extension in my php.ini file but I have the same warning can any one give me solution thank you


texts: Only Load required js scripts on particular page

texts:
Hi we have a custom theme where i have examined that only 16 js files are required on that page but the magento loads up 298 scripts which slows the home page speed.
so i want to know is there a way to stop loading those extra scripts and loads only that is required over the particular page. did anyone tried that
UPDATE:- AM TRYING TO STOP ADAPTER.JS FROM LOADING WHICH IS A MAGENTO LUMA JS
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
       <remove src="adapter.js"/>
    </head>
</page>


texts:
I want to have all the web in HTTPS, so I put like in the screenshot. The problem is that when I click in a product or other link (organic) in Google redirects to the homepage.

## enable rewrites

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]


texts: How can I display all active shopping cart price rules via a custom controller?

texts:
I've been asked to make a controller that will display all active shopping cart price rules. Then add description, number of uses etc.

I've created a custom module with a controller index:

app/code/local/Company/ActivePromotions/controllers/IndexController

Which contains this code:

class Company_ActivePromotions_IndexController extends Mage_Core_Controller_Front_Action{

    public function IndexAction() {

        {
        $this->loadLayout();

        $this->renderLayout();

        }
    }

The module block is here:

app/code/local/Company/ActivePromotions/Block/Page.php

It contains this code:

<?php

class Company_ActivePromotions_Block_Page extends Mage_Core_Block_Template

{
protected function _construct()
{
parent::_construct();
$this->setTemplate('activepromotions/1column.phtml');
}

The routers have been setup in /app/code/local/Company/ActivePromotions/etc/config.xml to display the data at: website.com/activepromotions

I've been advised to use this method:

Mage_CatalogRule_Model_Resource_Rule::updateRuleProductData

This is where I'm unable to get it to return anything.

How do I call the updateRuleProductData() method in the template file below?

/app/design/frontend/base/default/template/activepromotions/1column.phtml

Should I add the updateRuleProductData() to the Block.php file or use a Helper in my custom module?


texts: Magento 2.1 REST API configurableProductLinkManagementV1 only adds first simple product to configurable product

texts:
I'm making a call to REST API configurableProductLinkManagementV1. The first simple product is associated correctly. Any simple product after that is not. The error I receive states "option values are not specified". I'm passing in the following JSON:

'{"childSKU": "my SKU here"}'

I'm running Magento 2.1.0, PHP version 5.6.25-1+deb.sury.org~trusty+1, Apache/2.4.7, Ubuntu Linux 14.04, MySQL 5.6.33-0ubuntu0.14.04.1.

Only the first simple product has been added to the configurable product.  No other simple products get added.

What are the correct steps when creating simple/configurable products and associating the products to one another? And is there any where that I can find what the different REST API JSON objects represent? The REST API documentation doesn't give enough detailed information.


texts:
We currently have meta data set up in the individual products. However, I would create an automated meta description for all products (including backdating old products).

I know I could do this through import/export - but I want something that is automated going forward.

For example, my product meta description should be '[brand], [product-name], buy online today.'

I can find how to do this for opengraph meta content but not meta descriptions and key words.

Can anyone please assist?


texts: Magento 2 How to hide products from entire shop based on custom attribute value

texts: Is there any way by custom code or plugin, products can be hide from entire frontend shop based on custom attribute type yes or no ?


texts: Looking for the best 'search by car' extension

texts:
I am new to Magento, currently putting together my store and moving away from Prestashop. I have seen many extensions which are able to facilitate a search part by car model function but I dont know which is best. Does anyone have experience of any extension and could offer advice?

I have quickly searched on the main extension website and found some that are able to set variables which can be searched from the front end.

What I would like is an extension that can be set to have the following options.

Model Make Year

then within each product these are defined so when a customer enters their car make, model and year it only shows the relevant products


texts: How to change Quote Item attributes after adding it to cart?

texts:
I want to change almost all the quote item attributes after adding it to care like name,price,sku and almost everything. As we have a requirement where at the runtime only we will decide this attributes.
But I want to do that at Item level only and not at the product level.
I have tried using the observer but there I was able to change the item price only using $item->setCustomPrice();
But when I do $item->setName("Custom Item Name"); this does not work and item name does not gets saved.
Can some one please tell me what is the thing I am doing wrong or is there any other way by which I can achieve that.


texts: Getting error when trying to update Product Prices index in Magento

texts:
I'm getting the following error after attempting to index Product Prices in Magento: Invalid backend model specified: catalog/product_attribute_backend_startdate_specialprice

Screenshot here: http://grab.by/DRzK

Any advise what the issue is and how to resolve?


texts: Custom theme installed via composer require not showing in setup:static-content:deploy or admin panel

texts:
I've created my own custom theme and uploaded it to my private package repository. This works fine and downloads my folder into vendor/<vendor>/theme-my-theme
I run:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

My theme doesn't list itself in setup:static-content:deploy or in the admin panel. I then install snowdog/theme-blank-sass and this shows up fine.

Any ideas as to how to get Magento to register my theme? Please note that this theme was developed in app/design/frontend and worked fine.

composer.json:

{
    "name": "vendor/theme-my-theme",
    "description": "My Base Theme",
    "type": "magento2-theme",
    "version": "1.0.0",
    "require": {
        "magento/theme-frontend-luma": "100.1.*",
        "magento/framework": "100.1.*"
    },
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

registration.php:

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Vendor/my-theme',
    __DIR__
);

theme.xml:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
 <title>My Base Theme</title>
 <parent>Magento/luma</parent>
 <media>
     <preview_image>web/images/my-logo.png</preview_image>
 </media>

UPDATE:

I've found the cause of the problem. In Composer's installed.json file my theme declaration is missing the autoload section (as well as description). This means that Composers autoload_files.php isn't getting updated with my autload file registration.php.
Anyone know more about this or how to fix it?


texts: Need help with background and button colours

texts:
Using magento 1.9. My own version of the RWD theme.

If you notice there is still a white bar at the left and right after changing the background colour of my main container and my footer.

Any idea what I should be looking for in my CSS to also change the white bars at the sides to a different color? Also I would love to know how to do the same at the top right with my account and cart buttons, and search bar. Thanks


texts: Magento 2 commerce edition - How to set full width of cms block on cms page (Home page)

texts: I am using commerce edition, i am applied cms page row full width, still my cms block on home not full width, How to set full width of cms block on cms page (Home page)


texts:
In my magento store, I have implemented a custom module to add configurable products programmatically. In those products I have added Custom Option, a text field for user to input some data.

Now I have this requirement of retrieving all the values of the custom option entered by users who purchased the specific product. (I need to retrieve the values using the product ID)

Is there a way I can achieve this?


texts: Magento2 > Safely disable Add-To-Cart buttons

texts:
EDIT: This post apply to Magento 2.x

I would like to remove all add-to-cart button instances from my website.
I know I could do it from various way (removing that block with xml, removing from phtml...), while this is not an issue for me, I would like to know if there is a really safe way to do it in case I would have forgot to remove it from some place or the other. I want to completely remove the checkout and cart feature but wishlist and compare must stay.

Some specs:

Compare and wishlists are still enabled
Prices are listed


texts:
Magento 1 doesn't allow you to enter tare weight (that I can find), so you have to include the weight of the box/packaging materials into the total item weight of each product. This works great for just 1 item purchase.

But this is causing a problem when a customer buys multiple items. The weight of the box/packaging materials (tare weight) gets added in multiple times. So for example if a customer buys 4 hats the weight of the box should be added in only 1 time. But because you have to add the box into the weight of each item it gets added 4 times.

Has anyone figured out how to add tare weight in Magento 1 so when a customer buys multiple items the weight is calculated correctly?


texts: Migration Tool: Magento 1.9.2.0 To Magento 2.2.1

texts:
I was working on migrating Magento 1.9.2.0 to Magento 2.2.1

I successfully installed migration tool , but when I went to search for config.xml.dist file , it was not found in that place, so in this type of condition what should I have to do ?

looking for key solution , Thanks


texts: Magento 2: What is the most functional syntax for creating an admin grid?

texts:
I've seen lots of tutorials online, used mage2gen and read over the developer docs. Admin grids seem to have evolved over time. I'm just wondering if there are any suggestions on building a solid admin grid that has functional filtering, pagination, search and mass action. Ideally with minimal XML required.

I've read this https://devdocs.magento.com/guides/v2.3/ui_comp_guide/components/ui-listing-grid.html but really seems light on details. Plus I've seen several implementations in M2 git.

The grids generated by mage2gen seem dated. Going back a page is buggy.


texts:
I've got some problems with onestep checkout.

After filling both billing and shipping address I got an error (without message) and the process end.

How can I debug this problem?
I only read "error: true" in console.


texts:
I'm developing a bundle product module for magento 1.7

The module is working as expected with bundle products, however, issue appears with standard Magento configurable products - once I select size (simple product) and add it to cart, it automatically doubles product quantity.

For example:

if we have an Item 'X' in Size 'S' Qty = 1 : we will not be able to add it to the cart and there will be "The requested quantity for Item 'X' is not available"
Although if we change Item 'X' in Size 'S' Qty = 2, but still adding Item 'X' in Size 'S' Qty = 1 to cart,  then we are able to cart and checkout this item (note!! at this step magento will create an invoice with correct qty = 1 and prices, but once order is placed, Magento back-end will remove qty=2 from db row)

I have extended Mage_Checkout_Model_Cart with following:

/**
 * Get request for product add to cart procedure
 *
 * @param   mixed $requestInfo
 * @return  Varien_Object
 */
protected function _getProductRequest($requestInfo)
{
    if ($requestInfo instanceof Varien_Object) {
        $request = $requestInfo;
    }
    elseif (is_numeric($requestInfo)) {
        $request = new Varien_Object(array('qty' => $requestInfo));

    }
    else {

         if(isset($requestInfo['bundle_has_custom_options'])){
            if(!empty($requestInfo['options'])){
                foreach($requestInfo['bundle_simple_custom_options'] as $id => $opt){
                    foreach($opt['options'] as $key => $o){
                        $opt['options'][$key] = $requestInfo['options'][$key];
                        $requestInfo['bundle_simple_custom_options'][$id] = $opt;
                    }
                }
            }
            unset($requestInfo['options']);
        }
        $request = new Varien_Object($requestInfo);
    }

    if (!$request->hasQty()) {
        $request->setQty();
    }

    return $request;

}

Could it be that qty double comes because the system is adding qty=1 from extended bundle cart function and qty=1 from standard configurable cart function?

If any further info required, please let me know.


texts: Do I really need the sales_flat_quote_shipping_rate table?

texts:
We have a very simple logic for shipping methods and prices depending on the shipping country and the subtotal. We don't depend on any external API requests for the calculation. Do we really need to store the result inside the table?

My impression is, this table is only a performance optimization to avoid repeated expensive calculations or API requests to external shipping providers.

Has someone ever tried to turn this table off and found problems related to this? Which Problems were this?

But most importantly: do I really need this table, or can I workaround the logic to not use this table anymore?


texts: Prevent the quantity of inventory in the backend products is negative

texts:
I'm using Magento 1.7.0.2 and Magento 1.9.1.0.
As we know, by default, Qty Inventory at the backend (Admin - Catalog - Manage Products - Edit - General - Inventory - Qty) may contain a negative value, such as -1.

How to prevent the quantity of inventory in the backend products is negative?


texts: How to change page title for custom retailer signup form page

texts:
I have created a CMS page in magento says Retailer Signup  and set below xml in Layout Update XML

<reference name="content">
    <block type="customer/form_register" name="customer_form_register" template="retailer/customer/form/register.phtml">
        <action method="setShowAddressFields"><value>true</value></action>
        <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
            <label>Form Fields Before</label>
        </block>
    </block>
</reference>

Where retailer/customer/form/register.phtml is my custom form for retailer sign up. All are working but the title of page says Create New Customer Account.

I want to change it by Create New Retailer Account.

How to change page title only for custom signup form page?


texts: Magento 2 this is possible to set different SKU store wise on a same product

texts:
I want to set different SKUs for different store wise. This is Possible?

Example,

I have an ABC Product.

  For the English Store, I want 'En-Abc' SKU.

  For the Arabic Store, I want 'Ar-Abc' SKU.

I have checked with store wise but SKU takes a Global Value.


texts: I am facing an database rollback issues in Magento 2.3

texts:
Error
Static analysis:
1 error was found during analysis.

Unrecognized statement type. (near "LOCK" at position 58) SQL query:
-- -- Dumping data for table mgw2_inventory_stock_1 -- LOCK TABLES mgw2_inventory_stock_1 WRITE

MySQL said: Documentation

1146 - Table 'pinnacle_mage476.mgw2_inventory_stock_1' doesn't exist

Please help me fix it


texts: How to reorder "Apply Discount Code" field on last step of checkout?

texts:
I would like to reorder the "Apply Discount Code" to the top of the payment step. I had a customer who complained that the order of these elements indicated it was to be entered after payment, and so she accidentally paid before adding her coupon.

Here is what I've tried so far.

// File: <theme>/Magento_Checkout/layout/checkout_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body>
  <referenceBlock name="checkout.root">
   <arguments>
    <argument name="jsLayout" xsi:type="array">
     <item name="components" xsi:type="array">
      <item name="checkout" xsi:type="array">
       <item name="children" xsi:type="array">
        <item name="steps" xsi:type="array">
         <item name="children" xsi:type="array">
          <item name="billing-step" xsi:type="array">
           <item name="component" xsi:type="string">uiComponent</item>
           <item name="children" xsi:type="array">
            <item name="payment" xsi:type="array">
             <item name="children" xsi:type="array">
              <item name="afterMethods" xsi:type="array">
               <item name="children" xsi:type="array">
                <item name="discount" xsi:type="array">
                 <item name="sortOrder" xsi:type="string">1</item>
                 <item name="config" xsi:type="array">
                  <!-- <item name="componentDisabled" xsi:type="boolean">true</item> -->
                 </item>
                </item>
               </item>
              </item>
             </item>
            </item>
           </item>
          </item>
         </item>
        </item>
       </item>
      </item>
     </item>
    </argument>
   </arguments>
  </referenceBlock>
 </body>
</page>

I left the componentDisabled item in my example so I could mention that if I uncomment it, the "Apply Discount Code" field disappears. This tells me I'm doing something right.

Besides the above example, I've also tried nesting <item name="sortOrder" xsi:type="string">1</item> inside <item name="config" xsi:type="array">, to no avail. Lastly, I've tried a range of numbers including 500, 99999, 0 and -99999.

My guess is there is no way to surpass the sortOrder given to the payment methods group and so they need to be change but I don't know how. Can anyone help?


texts: Advanced search is partially broken after MySQL upgrade to v. 5.6

texts:
Maybe someone have been experienced the same problem and have solution for this?

My hosting provider was upgrading recently the MySQL version to 5.6 and after that the Advanced Search can not find anymore most of results searched by custom attributes. For example it gives results fine if you searching by “SKU” or by “Manufacturer”. No any results if you searching by custom attributes as “original code” and etc. even searching by “name” attribute does not work anymore. In default search they working (mini form) and they where working perfectly in Advanced Search also before the MySQL upgrade. Can anyone see some logic behind this and point to some direction to solve the problem?

Magento CE ver. 1.6.1.0

Any ideas? Anyone?


texts: how to use a different theme only for cart page and one page chackout page in magento

texts:
How can we use  different theme only for cart page and one page chackout page in Magento ?

I am talking about following pages:
- domain.com/checkout/cart/
- domain.com/checkout/onepage/.

Is it possible to do do with Admin > CMS > Pages ? Can some one please explain how to do this?