texts: Configure multiple redis services in single server

texts:
I am trying to configure redis service for multiple application in a single server. The app1 which is using the default redis i.e 6379. Now i need to configure a another redis for app2 i.e port 6400.
I have copied the configuration files and changed the pidfile, log, port and etc. I want to know how to enable that on the server.
OS: centos 7
Ref: http://www.jerrywenhaoliu.com/how-to-install-and-configure-redis-on-centos-7/


texts: Magento Secure Magmi from unauthorized access using htaccess

texts:
I'm using below htaccess file to prevent unauthorized access to Magmi.

  /{root_path}/{magmi_dir}/.htaccess

Order deny,allow
Deny from all
Allow from 127.0.0.1 202.131.115.180 xxx.xxx.xxx.xxx

this htaccess file is working fine when I'm trying to access Magmi from a browser but it's preventing me to access Magmi when I'm trying to call magmi script from observer using curl.

I've added 127.0.0.1 and server IP in htaccess to whitelist server itself but it's still not allowing me to access Magmi from the observer.

How can I whitelist server itself so that I can call Magmi script from Magento observer?

Thanks in advance.


texts: Image URL is broken for custom attributes in custom tab

texts:
In Magento 2.2.1: I created a custom attribute (let's say "photo"), then I created a photo.phtml to call the attribute as below:

<?php
$product = $block->getProduct();
?>
<?php echo $product->getData('photo'); ?>

I then displayed it on the product page as a new tab. I uploaded some image in the backend. While I am able see the images in the "More information" tab (which is the default tab showing additional attributes) I am not able to see any image in the "Photo" tab. All the images have broken link like this: hxxp://mydomain.com/{{media url=
Can someone point me to the right direction? How to write my photo.phtml correctly? Thanks.


texts:
I've been having difficulties accessing my site all it display is :

  This site can’t be reached

www.obeezi.com took too long to respond, Search Google for obeezi admin 8gh6g1 ERR_CONNECTION_TIMED_OUT


texts: How to remove some states from 'GetRegionHtmlSelect()'?

texts: I have implemented 'GetRegionHtmlSelect()' in my custom module. It shows dropdown for US states, is there any way to remove some states options from the dropdown?


texts: How to fix its MIME type ('text/html') is not a supported stylesheet MIME type error in magento 2.3?

texts:
Magento Version: 2.3.0

As per my client requirement, I was upgraded Magento 2.3.0 from 2.2.6.

All functionality works properly but always show the following error into inspecting element console.

Please suggest me how can I fix it into Magento version 2.3?


texts: Magento 2 New Order Status remains "Processing" instead of "Pending" in custom payment method

texts:
I have created a custom payment method module.

System configuration has a field for selecting New order status.

Even if I set it as "Pending", new order status is showing as "processing".

Please help..

namespace/module/etc/adminhtml/system.xml

<system>

            <group id="zipcodpayment" translate="label" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                Zip Limited COD Payment
                <field id="active" translate="label comment" sortOrder="1" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    Enable
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="title" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    Title
                </field>
                <field id="order_status" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    New Order Status
                    <source_model>Magento\Sales\Model\Config\Source\Order\Status\NewStatus</source_model>
                </field>
                <field id="allowspecific" translate="label" type="allowspecific" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                    Payment from Applicable Countries
                    <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
                </field>
                <field id="specificcountry" translate="label" type="multiselect" sortOrder="41" showInDefault="1" showInWebsite="1" showInStore="1">
                    Payment from Specific Countries
                    <source_model>Magento\Directory\Model\Config\Source\Country</source_model>
                    <can_be_empty>1</can_be_empty>
                </field>
            </group>

    </system>


texts: The sequence of Category form messed up after inserting a new attribute

texts:
I have a new attribute on category which is successfully installed and show on Category form. I planned to place it inside field group Display Settings which is successful. However, the sequence is messed up after installation.

Originally, the sequence was

Currently Active
Content
Display Settings
SEO
...

However after the attribute installation, the sequence changed to:

Content
Display Settings
Currently Active
SEO
...

So what's wrong with my installation? Here is my view/adminhtml/ui_component/category_form.xml:

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="display_settings">
        <field name="new_attr">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">200</item>
                    <item name="dataType" xsi:type="string">boolean</item>
                    <item name="formElement" xsi:type="string">checkbox</item>
                    <item name="prefer" xsi:type="string">toggle</item>
                    <item name="label" xsi:type="string" translate="true">New label</item>
                    <item name="valueMap" xsi:type="array">
                        <item name="true" xsi:type="string">1</item>
                        <item name="false" xsi:type="string">0</item>
                    </item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                    </item>
                    <item name="default" xsi:type="string">0</item>
               </item>
            </argument>
        </field>
    </fieldset>
</form>

And this is etc/module.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="0.0.1" >
        <sequence>
            <module name="Magento_Catalog" />
        </sequence>
    </module>
</config>

Thanks in advance!


texts: How to display custom field into admin order view page?

texts:
I created reward_point in the sales_order table, whenever someone purchased a few points stored in that field.

Now I need to display that point into the admin order view page, I already override sales_order_view and create the block, but failed to get the value of the reward point in view page.

sales_order_view.xml

  <referenceContainer name="order_additional_info">
      <block class="SimpleMagento\RewardPoint\Block\Sales\Order\ShowReward" name="sales_order_view_custom" template="order/view/custom.phtml" />
  </referenceContainer>

ShowReward.php

class ShowReward extends \Magento\Sales\Block\Adminhtml\Order\Totals
{
   public function _initTotals(){

    $this->_totals['reward_point'] = new \Magento\Framework\DataObject(
        [
            'code' => 'reward_point',
            'strong' => true,
            'value' => $this->getSource()->getReward(),
            'label' => __('Reward Point'),
            'area' => 'footer',
        ]
    );
    return $this;
   }
}

for the value of the reward_point I have override Order.php, which similarly look like:

public function getReward()
{
    return $this->getData(OrderInterface::reward_point);
}

but for that, I have to override OrderInterface, any other way to achieve this functionality?


texts:
Im using Magmi to import products and update the customer group prices, i have followed certain tutorials about how to set out the CSV files but the group price isnt changing, the price is so i know the import is working.

My CSV file looks like this

   | sku     |  group_price:Buying_Group|   price
   | TEST1234|  20                      |   40

The customer group is called Buying Group

I am not sure where i am going wrong, if anyone knows it would be much appreciated.

Thanks


texts: FedEx India Shipping Method in Magento 2 is not working

texts:
I am setting up FedEx shipping method in Magento 2 for FedEx India but it does not work.

How to setup for FedEx India? Will it work for India?


texts: Magento 2.3: Error Assigning Related Products

texts:
Trying to add some related / cross-sell and upsells to products in the admin but receiving the following error after saving the product:

  The linked products data is invalid. Verify the data and try again.

I checked my exception log and saw this:

main.CRITICAL: The linked products data is invalid. Verify the data and try again. {"exception":"[object] (Magento\\Framework\\Exception\\CouldNotSaveException(code: 0): The linked products data is invalid. Verify the data and try again. at /srv/public_html/vendor/magento/module-catalog/Model/ProductLink/Repository.php:141)"} []

What could be the issue here?


texts:
I am able to add the simple associated product of a configurable product using the code below.

                        <?php
                        $purchasableProductId = $product->getId();
                        if($product->getTypeId() == "configurable"):
                            $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($product);
                            $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
                            foreach($simple_collection as $simple_product) {
                                $purchasableProductId = $simple_product->getId();
                                break; //Break after first iteration since most configurable products have the first product as the most popular choice
                                //echo $simple_product->getId() . " - " . $simple_product->getName() . " - " . Mage::helper('core')->currency($simple_product->getPrice()) . "\n";
                            }
                        endif;
                        ?>
                        <form action="/checkout/cart/add/product/<?php echo $purchasableProductId ?>" method="post">
                            <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
                            <input type="hidden" name="qty" value="1" />
                            <button type="submit" style="position:absolute; bottom:0px; width:99%;" title="<?php echo $this->__('Add to Cart') . ' - $' . number_format($product->getPrice(), 2) ?>" class="button btn-cart"  ><?php echo $this->__('Add to Cart') . ' - $' . number_format($product->getPrice(), 2) ?></button>
                        </form>

My problem is that it is not added as an option, so the product does not show the parent configurable product's image in the cart as it would had I used the product view page to add the option to the cart.

How can I modify the form above to add the product to cart as an option rather than an independent product?


texts:
Can you help me? I have a Magento site that throws this error when I search for products:

a:5:{i:0;s:34:"The attribute model is not defined";i:1;s:4717:"#0
/var/www/mystore.com/public_html/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php(239):
Mage::throwException('The attribute m...')
#1 /var/www/mystore.com/public_html/app/code/local/Mana/Filters/Model/Filter/Attribute.php(63):
Mage_Catalog_Model_Layer_Filter_Abstract->getAttributeModel()
#2 ....

and this on my page 'The attribute model is not defined '
in system.txt i see this error

2014-02-05T11:15:36+00:00 ERR (3): Warning: chdir(): Permission denied (errno 13)

How i can solve this?

Thanks for any help.
Have a great day.
Greeting.


texts: Prototype.js error when insert image from admin editor in magento

texts:
I am getting below error :

Uncaught TypeError: a is not a function
    at d.initialize (prototype.js:1)
    at new d (prototype.js:1)
    at Object.openDialog (browser.js:48)

When insert image from admin editor and the popup window is blank.

How can I solve the issue? I a using magento 1.9.0.1


texts:
When I am opening a page or product in Magento 2 Backend, by default the text editor is opened. Actually by default WYSIWYG editor should be there.

Kindly help me!


texts: find all files/directories belonging to a specified module

texts:
Is there a standard method or has anyone found a way to somehow parse the directories of a magento install with a script of some sort to find all files and directories belonging to a module?

I'm hoping to be in a position where I can choose to both read and copy all occurrences of a module or just delete it as the script finds files and directories belonging to it.

This part of my requirement would be easy to implement myself if there was already something available to scan the magento install for a given module.

Example of process

select module - 'example module name'

select action - 'delete module' or 'copy module to chosen location'

run(); /* search module for all files belonging to selected module and execute chosen action */

I'm expecting to have to write the final part of this myself but if anyone has a starting point for me it would be a big help.


texts:
Warning: require(/var/www/html/xyz/vendor/composer/../symfony/polyfill-ctype/bootstrap.php): failed to open stream: No such file or directory in /var/www/html/magentopwa/vendor/composer/autoload_real.php on line 70

Fatal error: require(): Failed opening required '/var/www/html/xyz/vendor/composer/../symfony/polyfill-ctype/bootstrap.php' (include_path='/var/www/html/xyz/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/html/magentopwa/vendor/composer/autoload_real.php on line 70


texts: Exclude folders and files from static deployment

texts:
Is it possible to exclude files and folders from static deployment? In my case, I have a node_modules folder located in my theme folder. Right now, this folder is also copied to the pub/static folder.

The node_modules folder is located in the theme folder because I have a different Gulp configuration with different dependencies per theme. I'm not using the Grunt configuration Magento has provided.


texts: How to get product SKUs in onepageController without quote object?

texts:
I know product sku's can be fetched using the quote object and a foreach loop

foreach($this->getOnepage()->getQuote()->getAllItems() as $item){
    $sku = $item->getSku();
    $_SKU = $item->getProduct()->getSku(); // or this way
}

but I want to know whether there is any other short and crisp way to do this?
I mean without using foreach loop, i.e. a inbuilt function returning an array of product data in the quote.


texts: Add additional images of product via magmi

texts:
i am using magento 1.9, i add images in the product sheet by magmi through urls of external site. they works fine, but i want to upload more products photo in the product that have more than 10 photos. so there is no media_gallery row in product csv file. I learn the techniques of magmi product import but doesn't know the meaning of: sku,media_gallery
00001,/image1.jpg;/image2.jpg. how to use it. So please help me to understand it.


texts: Transactional email variables for product attributes

texts:
I want to edit a transactional email which is used for product returns. The current table columns all work, but I want to add in some additional product attributes, specifically ones in my store which are named "ref_color" and "ref_size".

I'm thinking it might be something like

<?php echo $this->escapeHtml($item->getProductRef_color()) ?>
<?php echo $this->escapeHtml($item->getProductRef_size()) ?>

Here's what is already there from the .phtml file:

        <?php echo $this->escapeHtml($item->getProductName()) ?>
        <?php $_options = $item->getOptions();
            if($_options): ?>

        <?php foreach ($_options as $_option) : ?>

<?php echo $this->escapeHtml($_option['label']) ?>

<?php echo $_option['value'] ?>

        <?php endforeach; ?>

        <?php endif; ?>

        <?php echo $this->escapeHtml($item->getProductSku()) ?>

        <?php echo $this->escapeHtml($this->getOptionAttributeStringValue($item->getCondition())) ?>

        <?php echo $this->escapeHtml($item->getStatusLabel()) ?>


texts: magento 1 use old cdn instead of new one

texts:
I have this in my settings:

But site still using old path despite I cleared cache


texts: Custom price is not getting calculated on cart magento 2

texts:
I am setting up the custom price with some calculation during add to cart and update cart.

I am using following code to add custom price

$fPrice = 39.1467 // after calculation
$qty = 24;
$item->setCustomPrice($fPrice);
$item->setOriginalCustomPrice($fPrice);
$item->getProduct()->setIsSuperMode(true);

Magento 2 calculating the row subtotal with this price and 24 quantity = $939.60 instead it should be $939.52. I have checked into the database and found that it is calculating with $fprice = 39.15 but I want to calculate with  $fPrice = 39.1467 to correct the subtotal value.

Any help would be much appreciated. Thanks.

Database item row :


texts: I'm migrating a bunch of xmlrpc API code from magento1 to the rest API in magento two, and was wondering if anyone knew the correct way to return API errors. Previously we would've been throwing a Mage_Api_Exception, but I haven't been able to find the matching magento 2 classes


texts: how i can override the observer of other modules in magento 2

texts:
how i can  override observer of other module(custom module)

  to my another custom modules in magento 2

  is it possible ???

Does anyone have an idea?

ex :

custom module 1:

the observer for catalog price change

custom module 2:

i want the price of changed by observer in custom module1.


texts:
I want to update products price with SQL. I already tried with my code below, but nothing happened. Is there something wrong on my code?

Block :

public function changePriceSql($csv){
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('catalog_product_entity_decimal'); //gives table name with prefix
    for ($i=0; $i < count($csv); $i++) {
        //Select Data from table
        $sql = "Update value FROM " . $tableName . "Set value =" .$csv[$i][1]. "WHERE value_id =" . $csv[$i][0];
        $result = $connection->fetchAll($sql);
        echo '<pre>'; print_r($result); echo '</pre>';
    }
}

phtml :

$check = $this->changePriceSql($csv3);

$csv3 contain data from csv file : id, price, qty.


texts: How to check if admin user is logged in on frontend

texts: I was wondering how it is possible to check if admin user is logged in on the frontend?


texts: Custom Availability not working anywmore with new template [magento 1.9]

texts:
When I set up a product in stock "-1" the availability is not displayed, the product always displays "In Stock".

Is it possible to add a condition for products in stock "-1" to display the "Availability" custom message set in product ? (and keep In Stock/Out of Stock)

  file:
  /app/design/frontend/default/themeXXXX/template/catalog/product/view.phtml

            <?php if ($_product->getTypeId() == "simple"): ?>
                <?php if ($this->displayProductStockStatus()): ?>
                    <?php if ($_product->isAvailable()): ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('In stock') ?>

                    <?php else: ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('Out of stock') ?>

                    <?php endif; ?>


texts:
I tried to install a new extension on my Magento site (version 2.2.0).
I created a new folder in app/code/ like this

  app/code/SendGrid/EmailDeliverySimplified

After that I run this command

php -f bin/magento module:enable --clear-static-content SendGrid_EmailDeliverySimplified

I had this return "The following modules have been enabled : -SendGrid_EmailDeliverySimplified".
To be sure, I upgrade and recompile my site.

When I go in the admin panel, I see my module in the "System" menu :

When I click on "Settings" or "Statistics", I have this error message :

Could you help me please?

Thanks in advance for your help.


texts:
How to disable the cart function by Magento administration panel?
Shortcuts to get it up


texts: Add the search box to the bottom menu in Magento 2?

texts: Add the search box to the bottom menu in Magento 2 ?


texts: Magento 2 disable COD payment method on checkout from observer

texts:
I need to disable COD option from observer, For observer my code is:

public function execute(\Magento\Framework\Event\Observer $observer)
  {
  $order= $observer->getData('order');
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$quote = $observer->getEvent()->getQuote();
$QuoteData = $quote->getItemsCollection();
$checkResult = $observer->getEvent()->getResult();

    foreach($QuoteData as $data) {
             $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $p = $objectManager->get('Magento\Catalog\Model\Product')->load($data['product_id']);
            $attribute = $p->getResource()->getAttribute('cod');
            if ($attribute)
            {
                  $attr_value = $attribute ->getFrontend()->getValue($p);

                    if($attr_value == 'Yes' || $attr_value == 'yes' || $attr_value == 'YES'){ return;
                        $code = $observer->getEvent()->getMethodInstance()->getCode();
                             if($code == "cashondelivery" || $code == "mpcashondelivery"){

                             $checkResult->setData('is_available', false); //this is disabling the payment method at checkout page

                            }
                    }
            }
        }

  }

But COD is not disabling if anyone have solution please share.


texts: Magento 2 : Add Custom Field To Order, Invoice, Shipment, Credit Memo

texts:
I created one custom field in sales_order table, field name is mycstfield.

I save my value in that field sucessfully when order is placed.

Now, I want to send that field value in following places.

Order Email (From Admin)

Inoive Email and Invoice Print (PDF)

Shipment Print

Credit Memo Email and Credit Memo Print (PDF)

Can Any one have idea about this, How can I do this.


texts: Boolean attribute where only one product can have a value of "true"

texts:
I have setup a product attribute for showing the product in a space on the left side of the store. I only want to display one product in that space and therefore would like to only have one product that had the attribute set to 'true'.

For example, if one product already had the leftbanner attribute set to true saving another product with the leftbanner attribute as true would change the first products attribute to 'false'.

I've tried setting the attribute to have the 'unique' flag, but as expected I get an error when saving another product saying the value must be unique.


texts: Out of stock products not showing (Community 1.8)

texts:
I want 'out of stock' products to show in the store, but despite the option System/Configuration/Inventory/Stock Options/Display Out Of Stock Products being set to yes they still don't show.

Is there another setting that could be overriding this?


texts: Which payment method use for US Doller and INR (Indian rupies) in magento 2.2.x?

texts: I have create 2 store and 2 different currency like US Doller and INR. So i want to create one payment method to use both of store in magento 2.Please give me suggest which payment method use.


texts: Magento Community forum posts not appearing

texts:
I'm experiencing issues posting to the Magento Community forum. Whenever I post something, it won't get published.

Is anyone experiencing the same? What can the reason be for this?

We contacted Magento support awhile ago but didn't get a response.

Community forum: https://community.magento.com/


texts: Magento 2: How to Change fieldset accordion in product edit page to tab in backend?

texts: I have a lot of product attribute set in the backend , and it  is not convenient to scroll all the way down to edit product page information, How can i change the accordion in the product edit backend to tab in Magento 2 just like in Magento 1 ?


texts: Magento 1.9.3.2 - Call to a member function getBackend() on boolean

texts:
Error when try change the password of a customer from of the backend.

Fatal error: Uncaught Error: Call to a member function getBackend() on boolean in /app/code/core/Mage/Eav/Model/Entity/Abstract.php:1554

In the line 1554 of the Abstract.php file have this:

$backend        = $attribute->getBackend();

I see and i have the attribute rp_customer_id created correctly.

Any idea?.


texts: How to Get All Custom Category Attribute Values?

texts:
I have created module that add custom attribute in Manage Categories section. Say My custom category attribute is category_sku, and it is a text field.

I see that the value of my custom attribute is stored in catalog_category_entity_text table.

But how to populate all the values of it?

I tried using the below code, but it return NULL.

Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'category_sku')->getValue();


texts:
I have created multiple stores with multiple domains but when I select a store from frontend than giving below error.

I have attached the screenshot of the error.

Store Cookies does not set on multiple domains

I have debugged and checked the code and print($fromStoreCode) but give blank.
Magento\Store\Controller\Store\SwitchAction.php

$fromStoreCode = $this->_request->getParam(
            '___from_store',
            $this->storeCookieManager->getStoreCodeFromCookie()
        );
echo "<pre>";
print_r($fromStoreCode);

The store that was requested wasn't found. Verify the store and try again.

Thanks in advance.


texts: Please Wait... When trying to edit a large Categories' name?

texts:
I'm editing a bunch of categories for this Magento site and I am hitting a wall.

I'm only trying to change the Name, the status of the Is Active and the Includes in Navigation Menu.

On the categories that contain a low amount of products, it works fine, updates within a few seconds..

On the categories with say over 100 products, it seems to be stuck on a 'Please Wait..' pop up box screen.


texts: Admin module with as many image slots as user needs?

texts:
Something I use a fair deal in wordpress is allowing users to duplicate a field, so i provide one image slot and they can click a [+] button and get another image slot.

I'm trying to make a quick blog module and was wondering if there is something similar to this or if I'll just need to build in say 10 image upload slots for the module?


texts: I have a php script (Ajax commenting) written in php. It was not written to be a Magento extension. Let us say I want to install it in my site -Magento store-, what are the common practice to do so. In another word, for any third party php script, I want to install these scripts within Magento installation so that I can add Magento codes in the new php script files ( for example, check if Magento user is logged in). I am sure I will need to modify codes in the new script, but these modifications require me to call Magento helper classes. How to install new php script so it has access to Magento classes.


texts:
We are having this issue with making API calls to Magento 2.
We are working with Magento EE ver. 2.3.5-p2.
Making calls: https://localhost/rest/all/V1/products/mreht.Digit?editMode=false&forceReload=false
We get a 200 response.
Making Calls: https://localhost/rest/all/V1/products/co.git.c?editMode=false&forceReload=false
We get a 404 Not Found.
This 404 Not Found is a different response than PRODUCT NOT FOUND.
We played a little with this and in every case we got the 404 Not Found error it was when the sku field in case had '.git' in it.
Has anybody run into this type of issue? Is it the fact that the sku contains .git or is Magento finally getting to me?


texts: Saving category from collection resets include_in_menu

texts:
Sometimes it is convenient to save a category directly from the collection it was loaded. For instance, for all categories of which the name attribute starts with foo, I want to update the meta_title attribute with the name followed by bar as follows:

/** @var Mage_Catalog_Model_Resource_Category_Collection $categoryCollection */
$categoryCollection = Mage::getResourceModel('catalog/category_collection');
$categoryCollection->setDisableFlat(true);
$categoryCollection->addAttributeToFilter('name', ['like' => 'foo%']);
foreach ($categoryCollection as $category) {
    /** @var Mage_Catalog_Model_Category $category */
    $category->setData('meta_title', $category->getData('name') . ' bar');
    $category->save();
}

This does work, but as side-effect: the include_in_menu attribute is reset to 1.

What is the cause of this and how can this be circumvented?


texts: Additional Information managable via dashboard

texts:
I am using additional.phtml to add some custom extra information to 1 best-of-product of mine - like images, videos or text and I do this by hardcoded adding of markup-code directly to the additional.phtml-file in a separate sub-package - ouch, I know. Now I want to extend this functionality to more products and I am wondering, if this isn't doable via the dashboard directly to also keep it managable more easily.

Therefore I added 3 CMS static block in the dashboard and would like to integrate block_1 into product_1's page and block_2 into product_2's page ... and I use this in the additional.phtml-file of my theme

<? echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_1')->toHTML(); ?>

But I have no clue on how to now define, that block_1 shall be shown on product_1 etc. Where would I need to do that? In the dashboard?

UPDATED

Based on the given hint of Amit, I added a new attribute and some cms-blocks and I am doing this now in my additional.phtml-file

<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct();
if (!$_category = Mage::registry('current_category')) {
    $_product = Mage::getSingleton( 'catalog/product' )->load( $_product->getId() );
}
$_product->getSetCms();
echo $this->getLayout()->createBlock('cms/block')->setBlockId($_product)->toHTML(); ?>

But I do get a: Fatal error: Call to a member function getId() on a non-object
What am I doing wrong here?


texts: Magento 2 : Product custom yes_no attribute value not save from admin

texts:
I have added an product yes_no attribute named save_print from admin. It has successfully added and showing in product(admin). When I change the value. Value is not reflecting in back-end.

I have debugged into this and found that attribute value doesn't insert into database. I thought, It may be due to php post_max_size. So I have increased the value of post_max_size to 32M and upload_max_size to 32M but it didn't work. I don't why it is happening. Please help to solve this.

Here is the attribute database

Any help would be appreciated.

Thanks,


texts: How can I change the design for a single cms page content heading?

texts:
I've been trying to set a custom design for a cms page, but I can't seem to figure out how to reference it.  I just need to add a class to it, so I created a template as in the instructions here only I want to change the Content Heading, not the page header.

What block should I be referencing?

I tried this:

<reference name="content">
<block type="core/template" name="page_content_heading">
    <action method="setTemplate"><template>cms/headers/custom.phtml</template></action>
</block>
</reference>

But that also displayed my custom design at the bottom of the page


texts:
I have a coupon where the customer needs to be logged in before they can use it. At the moment the error message is just "Coupon code xxxxxxxx is not valid."

Is it possible to change this and detect that the coupon requires the customer to be logged in and to report that in the error message


texts: Magento 2: my_variable is not defined in ArraySerialized

texts:
I'm trying to make a custom store configuration with ArraySerialized
But at first, i try with 2 column and it working fine, i've successfully in created and get data from it, but then, i created 1 more column, and this issue show up

I've searched a lot but still no luck, please help
Here's what i done:

  etc/adminhtml/system.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>

            <class>separator-top</class>
            Careers
            <tab>gssi</tab>
            <resource>Gssi_Contact::contact_config</resource>

            <group id="gssi_career_group" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                Career Subject
                <field id="gssi_career_field" translate="label" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1">
                    List Careers
                    <frontend_model>Gssi\Career\Block\System\Config\Form\Field\Fields</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                </field>
            </group>

    </system>
</config>

  Gssi\Career\Block\System\Config\Form\Field\Fields

<?php
namespace Gssi\Career\Block\System\Config\Form\Field;

use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;

/**
 * Class Active
 *
 * @package Gssi\Contact\Block\System\Config\Form\Field
 */
class Fields extends AbstractFieldArray {

    /**
     * @var bool
     */
    protected $_addAfter = TRUE;

    /**
     * @var
     */
    protected $_addButtonLabel;

    /**
     * Construct
     */
    protected function _construct() {
        parent::_construct();
        $this->_addButtonLabel = __('Add');
    }

    /**
     * Prepare to render the columns
     */
    protected function _prepareToRender() {
        $this->addColumn('subject_code', ['label' => __('Subject Code')]);
        $this->addColumn('subject_label', ['label' => __('Subject Label')]);
        $this->addColumn('subject_email', ['label' => __('Subject Email')]);
        $this->_addAfter       = FALSE;
        $this->_addButtonLabel = __('Add');
    }
}


texts:
I am trying to implement this circular timer on product Detail page
by following the instructions.

my catalog_product_view.xml code is

    <?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <link type="text/javascript" src_type="url" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"/>
    <link src="Vendor_module::js/TimeCircles.js"/>
    <css src="Vendor_module::css/TimeCircles.css"/>

        <referenceBlock name="product.info.stock.sku" >
            <block class="Vendor\Module\Block\Product\Banner" name="timers_product"
                   template="Vendor_module::product/timer.phtml" after="product.info.stock" />
        </referenceBlock>

</page>

my timer.phtml code is

  I'm getting this Error in console

>Uncaught TypeError: $(...).TimeCircles is not a function
>at HTMLDocument.<anonymous> (push-it-messenger-bag.html:815)
>at fire (jquery.js:3232)
>at Object.add [as done] (jquery.js:3291)
>at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)
>at jQuery.fn.init (jquery.js:2967)
>at new jQuery.fn.init (jquery-migrate.js:225)
>at jQuery (jquery.js:75)
>at push-it-messenger-bag.html:814
>at Object.execCb (require.js:1650)
>at Module.check (require.js:866)

My Directory Structure

->Vendor
  |-->Module
   |-->view
    |-->frontend
      |-->templates
        |-->product
          |-->timer.phtml
      |-->web
        |-->css
          |-->TimeCircles.css
        |-->js
          |-->TimeCircles.js


texts: Magento 2 Header Sign In Sign Out Issue on Home Page

texts:
I'm facing an issue on Magento 2.2 . The details are as under

1.Go to home page

2.Click 'Sign In' from header

3.Enter login credentials to enter customer account

4.Click website logo to go back to home page

5.Notice that on the home page the header is still showing 'Sign In' instead of showing the customer is logged in and a 'Sign Out' link.

can anybody help me out


texts: Why my template file is not overwritten by the extension

texts:
i have an extension that modifies the add to functionality on a product page (add to wishlist, ...). The extension has the following layout xml .

<!--produt detail page-->
<catalog_product_view>
        <reference name="product.info.addto">
            <action method="setTemplate"><template>shoppinglist/catalog/product/view/addto.phtml</template></action>
        </reference>
</catalog_product_view>

However, magento renders the addto.html file from mytheme/default/template/catalog/product/view/addto.phtml instead of shoppinglist/catalog/product/view/addto.phtml

What am i doing wrong?


texts:
How to Add Customer Attribute in magento 2.2.2 and display it in the front end ?

beacuse i saw mamy post but not working in 2.2.2 thank you!!


texts: Magento2: what is the best way to detect mobile device?

texts:
I have used below code to detect mobile in magento1.

$isMobile = Zend_Http_UserAgent_Mobile::match(
    Mage::helper('core/http')->getHttpUserAgent(),
    $_SERVER
);

I am not sure if there is something available for Magento2 as well. Anyone have used something like this in magento2?


texts: Magento1.9 : An error occurred while processing this directive

texts:
I Configure Sub domain Unfortunetley I got this error

  [an error occurred while processing this directive]

I don't Know What is the problem on it. Front end it's opening but it show's this error Backend it redirect to Live Backend.

I don't know it's related to server error or Magento Error can any one please guide me on this?


texts: How can I get abandoned cart collection?

texts:
How can I get the abandoned cart collection on Magento 2? I want to collect it via controller.

Could anyone please help me?


texts:
I have started investigating alternatives to my project and a few questions came out that I couldn't answer by myself.

The problem is: I want to create a web page able to access multiple Magento instances installed on the same server. Currently, I have one Magento instance per client and this project will access several Magento instances to export reports from each one (for example).

The alternatives I thought til this moment are:

Have another Magento instance, create a new module within it that changes its 'database target' before triggering operations/queries;

Questions until this moment:

Can I 'change the database target' of a Magento instance?
How can I access data from a Magento instance without appeal to SOAP/REST?
I want to re-use some components (grids, tabs, forms..) from Magento, that's why I'm not considering an independent project (Zend, for instance) that can access this code from another project. Does it make sense?
Any other idea?

==Edited==

Thanks by the tips and sorry by my ignorance. The comments let me believe that I'm able to execute something like this:

// File myScript.php
require '/home/DOMAIN1/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN1

require '/home/DOMAIN2/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN2

Is it right? Can I execute require twice (and override things from first require)?


texts:
We're currently using Magento CE v1.8 and are subject to the bug which causes product URL keys to be appended with an incremental number every time we run an index, which in turn is causing a large amount of URL rewrites to be generated each time as well. However, with the way our site operates we only use the category URL paths/keys i.e. the product URLs are not included in our sitemap and are not published for the public to use.

My question is; would there be a problem if we just removed all of the product URL keys?


texts: Magento 2: How to add custom block after the add to cart [Custom Theme]

texts:
I want to add a block after add to cart but this code doesn´t work:
app/design/frontend/Mgs/claue/Magento_Catalog/layout/catalog_product_view.xml

<block class="Magento\Catalog\Block\Product\View" name="product.info" template="product/view/form.phtml">
    <container name="product.info.form.content" as="product_info_form_content">
           <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="product/view/addtocart.phtml"/>

           <!--THIS BLOCK-->
           <block class="Magento\Catalog\Block\Product\View" name="custom.cuidados" template="Magento_Catalog::product/view/cuidados.phtml"/>
           <!--===========-->

    </container>

</block>

What is the problem??
Thankss


texts: Magento Communitty setting up related products

texts:
Is there a way to setup related products to do a two way relationship instead of just a one way relationship.

If I relate product a with b then b should be related to a automatically.

I get my products from an API and the API doesn't allow me to map products together that are the same except for flavor together.  I'm hoping to be able to map the similar products together using related products.

Thanks


texts:
I try to install magento 2.0.1 on cloud9 (c9.io) but keep getting a redirect loop when calling the admin site.

http://mage2-lptt.c9users.io/admin_1a798x/
same with https.

The Log only shows:

  [Thu Jan 28 09:24:14 2016] 10.240.0.174:33786 [302]: /admin_1a798x/
  [Thu Jan 28 09:24:15 2016] 10.240.0.188:41942 [302]:
  /admin_1a798x/admin/index/index/key/1e30bc5f51f9e34b0a6234eaef2e20b03618a98c119c8ca17875e3977b929de2/
  [Thu Jan 28 09:24:15 2016] 10.240.0.177:57048 [302]:
  /admin_1a798x/admin/index/index/key/1e30bc5f51f9e34b0a6234eaef2e20b03618a98c119c8ca17875e3977b929de2/

...

Any ideas how to resolve this?


texts: Magento writes system.log with log disabled

texts:
I disabled logging from the System > Advanced > Developer screen (I've checked that is disabled for all the websites/stores/storeviews) but Magento continues to write errors inside "/var/log/system.log" like:

[...] ERR (3): Warning: simplexml_load_string(): [...] in /lib/Varien/Simplexml/Config.php on line 383

Are there errors that ignore the admin backend setting?


texts:
I am rebuilding our webstore at the moment, and we are using a new theme that is installed over our old one. At the moment I am facing the following problem:

When i go to the product page, the layout how it should be is way different than what the installed demo looks like:

Now our one looks like the following:

What is going wrong where? Did i do something wrong in the xml files? I have set up the right one but i think its making a mistake somewhere.

you can find the site here: tfgs.hypernode.io


texts:
I've always installed extensions by default by putting all files in the directory.

I found a PDF generator which must be installed by composer.

https://github.com/EaDesgin/magento2-pdf-generator2?utm_source=mageplaza&utm_medium=mageplaza&utm_campaign=mageplaza-review&utm_content=Invoice

I have opened the SSH console in the magento root directory and try to run first command:

composer config repositories.magento2-pdf-generator2 git git@github.com:EaDesgin/magento2-pdf-generator2.git

Unfortunately, get error:

command not found

Can anyone help me how can I install this module by composer?


texts:
Like PWA everyone has started to use the word "Headless Magento" but I didn't find anyone to explain it in that detail.

Till now, I only managed to understand that it prefers to use react than knockout js where it creates a bridge between Frontend and Backend to load the page even faster but it was all about theory.

Can someone explain it in a proper way with a real example rather than an emphasis on theory?


texts: Magento 2: Composer update / install is no longer copying magento2-base structure

texts:
I've got this strange problem I ran into only since recently.

Usually, when I got a new or existing project and I run composer install or composer update, composer will automatically copy (map) the contents of magento2-base to my project root. So magento2-base/lib gets copied to /lib and magento2-base/app/bootstrap.php gets copied to /app/bootstrap.php and so on...

But for some reason composer is not doing this anymore. Does anyone has any clue on how this can happen? I'm experiencing this issue all of a sudden since last Friday.


texts: Multiple products, different units, one inventory

texts:
The scenario is as follows:

Product A, SKU 1000, sold as 1 roll of 1000 meters of cable, price 800 euro
Product B, SKU 1000, sold per meter of cable, price 1 euro

Those products should share the same inventory, if one piece of product A is sold, the available quantity of both products should be reduced automatically (product A by 1, product B by 1000). If 500 pieces of product B are sold, the available quantity of both products should be reduced automatically (product A by 1, product B by 500).

So its like this: multiple products, same SKU, different units, same inventory.

I am working with Magmi to import products into Magento so I think using a 3rd party plugin is not an option here. Whats the best solution in this case? I have done quite some research but haven't found how to tackle this issue.


texts: how to remove layerd navigation on checkout page in magento

texts:
I have tried to remove layered navigation on www.example.com/checkout/onepage/ by adding
 checkout.xml
1 .first solution
<reference name="left"><remove name="catalog.leftnav"/>
    </reference>
2 . second solution   <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
3. adding <remove name="left"/> at <checkout_onepage_index translate="label">

added code at local.xml to make it 1column view <?xml version="1.0"?> <checkout_onepage_index translate="label"> <reference name="root"> <action method="setTemplate <template>page/1column.phtml</template></action> </reference> </checkout_onepage_index translate="label">

But it still remains there,I want to remove it only from checkout page only are keep it on other pages.What I have to do here ??? Please help ASAP.


texts: Display out of stock for components of grouped products

texts:
How can I display "out of stock" for individual components of grouped products, when any of the  individual component (simple product) goes out of stock?  As it is now it displays the quantity boxes, even if the simple product is out of stock!

Is there an admin setting for this?

While searching, I found this link. Is this the way to do it?  Or is there a better method.  Thanks


texts: Magento 2.4.1 Move Out of Stock In last Of Category Listing

texts:
I want to move out of stock product in last of the category listing, itried below code but same seems not working.
app/code/Meetanshi/StockQuantity/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
   <module name="Meetanshi_StockQuantity" setup_version="1.0.0"/>
</config>

app/code/Meetanshi/StockQuantity/etc/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
   <event name="catalog_block_product_list_collection">
       <observer name="stockLast" instance="Meetanshi\StockQuantity\Observer\StockLast" />
   </event>
</config>

app/code/Meetanshi/StockQuantity/Observer/StockLast.php
<?php
namespace Meetanshi\StockQuantity\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\Event\Observer;
use Magento\Catalog\Block\Product\ProductList\Toolbar as CoreToolbar;
class StockLast implements ObserverInterface
{
   protected $scopeConfig;
   protected $_storeManager;
   protected $coreToolbar;
   public function __construct(
       ScopeConfigInterface $scopeConfig,
       StoreManagerInterface $storeManager,
       CoreToolbar $toolbar
   )
   {
       $this->scopeConfig = $scopeConfig;
       $this->_storeManager = $storeManager;
       $this->coreToolbar = $toolbar;
   }
   public function execute(Observer $observer)
   {
       $collection = $observer->getEvent()->getData('collection');
       try {
           $websiteId = 0;
           $stockId = 'stock_id';
           $collection->getSelect()->joinLeft(
               array('_inv' => $collection->getResource()->getTable('cataloginventory_stock_status')),
               "_inv.product_id = e.entity_id and _inv.website_id=$websiteId",
               array('stock_status')
           );
           $collection->addExpressionAttributeToSelect('in_stock', 'IFNULL(_inv.stock_status,0)', array());
           $collection->getSelect()->reset('order');
           $collection->getSelect()->order('in_stock DESC');
           //code for Filter Price Low to High or High to Low with stock filter.
           if ($this->coreToolbar->getCurrentOrder() == 'price') {
               $direction = $this->coreToolbar->getCurrentDirection();
               $collection->getSelect()->order("min_price $direction");
           }
       } catch (\Exception $e) {
       }
       return $this;
   }
}


texts: Recently Viewed showing 404 Not found URL for Prodcuts of other stores

texts:
I have two stores City 1 and City 2 under a same website instance of Magento. I have created two separate categories as city1 and city2. Both these categories have individual sub category "phones" and each sub category has products which are distinctly unique to that category (meaning product assigned to city 1 will not be assigned anywhere in city 2 and vice a versa). Lets say I am in City 1 and viewed details of one of the product (lets say product A). In my recently viewed products I can see Product A is appearing. I change my city to city 2. Still I continue to see Product A. When I click on the product, I get 404 Not found.

I am ok if the product is shows up when I click on the product in recently viewed. To enable this feature, I changed the visibility of store view of city1 as catalog,search and changed the visibility of product A in store view city2 as catalog. This solves the problem of viewing the product from recently viewed.

The next problem is when I click on the product A from City 2, The breadcrumbs shows home/City1/Phones/phonename. If i click on City1 or Phones from that breadcrumbs, i again get 404 not found. Here I am completely lost as to what should be the solution.

Please help!

I am using Magento 1.9


texts:
I want to do few action with Magento tabs

1: How can i disable tabs

2: I have button other than tabs i want that when button is clicked tabs 3 get open automatically

How can i do it?


texts: Why are attributes like `status` and `tax_class_id` used in quick search by default?

texts:
In a fresh installation of Magento the attributes status and tax_class_id have "Use in Quick Search = Yes" by default. I can't see any reason why these attributes should be searchable and I always have to go in and disable them.

Am I missing something or is this an oversight?


texts: Magento Enterprise - Product Search use a specific scope view

texts:
I have a question. I have a Magento Enterprise and have two store views. Each store view has slight different products. What I want is when I am in a store view lets say one of them is called USA and I do a product search I need the search box to realize I am in the "USA" store view and only search for the products that are setup within that store view.

My question is what mysql table would the relationship be stored that connects a product to a specific store view? Or how would I alter the query to take into account what store view the end user is currently viewing?


texts: I'm trying to make a accordion faq page on mobile but it should be open by default? It's working when i use this line of code $( "#accordion" ).accordion( "activate" ); is there a counter part for it? I would like to use data-mage-init instead.


texts: Magento 2 Credit memo array get only one item

texts:
public function execute()
{

    $yourDate = date('2019-11-17');
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $collection = $objectManager->get('Magento\Sales\Model\ResourceModel\Order\Creditmemo\Collection');
    $collection->addFieldToFilter('created_at', array('gt' => $yourDate));

    foreach ($collection as $creditmemo):
    $data = $creditmemo->getData();
    $this->createNewCreditMemoHead($data);
    endforeach;

}


texts: Manipulating variables in jQuery to be displayed in html code

texts:
I make a request in Ajax at the click of the button passing the id of a product to a controller and it passes to the helper. In the helper, through this id of the product, I add it to the cart, but that does not matter much on that issue. In this helper, I create an array with data and give a return on it and then the controller returns me that array. When I give an alert in the array, specifying the position of the array, it shows me the value. I wanted to display this array value in HTML code (in case it would be in h1 that I put in append).

Ajax request:

        function addCartao(product_id){
            alert("entrou");
            alert(product_id);
            $j.ajax({
              type: "POST",
              url: "<?php echo Mage::getUrl('fol_carousel/ajax/teste') ?>",
              data: {
                product_id: product_id
              },
              dataType: 'json',
              cache : false,
              beforeSend: function () {
                alert("beforeSend");
              },
              success: function (retorno) {
                alert('success');
                alert(retorno['name']);
                $j('.item-custom').append('
(
The exact position value of the array should be displayed here)
');
              },
              complete: function () {
                alert("complete");
              },
              error: function (x,y,z) {
                alert("error");
                alert(x);
                alert(y);
                alert(z);
                window.location.reload();
                history.go(0);
                window.location.href=window.location.href;
              }
          });
        }

Controller code:

$product_id = $this->getRequest()->getParams();
$dados = Mage::helper('fol_carousel/cartao')->addCustom($product_id);
echo json_encode($dados);

Array I create in the helper:

$dados['name'] = 'Teste';
$dados['price'] = "2.99";
return $dados;


texts:
Assuming I got 2 components like this:
How can I pass data from 1 component to another?

In this example I would like to pass some data when I close the modal to "my-component"

HTML nesting of the elements

and this is how the elements look like in the JS at least for now.

define([
    'jquery',
    'uiElement',
    'Magento_Ui/js/modal/modal',
    "ko"
], function (jQuery, uiElement, modal, ko) {
    "use strict";
    return uiElement.extend({})
})

I tired few things, like using the same scope would probably solve my problem but that would leave me with 1 component instead of 2.


texts:
When adding products to a cart, viewing the cart ect. It works as expected in Firefox however in Google Chrome when click 'Add to Cart' it just takes the user to a empty cart page.

Something to do with the Google Chrome Cache?


texts: After migration customers can't log using m1 password

texts: I migrated the M1EE 1.12.0.2 to M2EE 2.1.5 using the data migration tool provide by Magento. Now after migration the existing customer unable to login and magento 2 is throwing an error "Invalid login".


texts:
Parse error: syntax error, unexpected end of file in
  C:\xampp2\htdocs\magento1.9\app\design\frontend\rwd\default\template\catalog\product\list.phtml
  on line 216

<?php // Grid Mode ?>

<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = $this->getColumnCount(); ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>

    <?php if ($i++%$_columnCount==0): ?>

    <?php endif ?>

    <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">

    <?php if ($_product->getAttributeText('new') == "Yes"): ?>
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('free-shipping')->toHtml() ?>
    <?php endif; ?>

    <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
        <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(153); ?>" width="153" height="153" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />

        <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

    <?php if($_product->getRatingSummary()): ?>
        <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
    <?php endif; ?>


texts: Magento1.9 shipping method must be specified when admin edit orders

texts: I am trying to edit order in the admin section when showing "Shipping method must be specified." enter image description here


texts: Disable Module in integration tests / how is the sandbox config.php written

texts:
I have set up stock Magento 2 Integration testing as shown in the dev docs.
Are disabled certain modules in the app/etc/config.php

But when running the test and after deleting that folder, the modules are still enabled in

dev/tests/integration/tmp/sandbox-0-54be8c7a21df5063f2e3428151001d45/etc/config.php

Do I want to understand what is happening there? Is that cached in the normal Magento cache? Or does the integration sandbox always enabled all modules?


texts: Magento Order Confirmation mail and newsletter mails are not going

texts:
I am having Magento 1.9.3 and i am new to Magento. My newsletter subscription and order confirmation mails are not sending. I have checked all things in Magento configuration. Seems its the trouble with cron on server. But with out knowing i do not want to make changes on server. I am using A2 hosting provider, and there is a cron set like this, which runs for every 30 mins.

/bin/cagefs_enter.proxied php /home/lasakico/public_html/cron.php 1>/dev/null 2>/dev/null

I am not sure what is the problem, either its the problem with cron or magento.

I have checked Magento Configuration->Advanced->System->Cron, where values are stored for Generate Schedules Every : 15. and rest are like 20, 15, 10, 60,600

Please let me know if anything is not clear in the question. I will ans them.


texts: Customize header logo link via the admin

texts:
I am working with a custom theme in Magento 2.1.  I would like site administrators to be able to set the header logo's link via the admin config.  This link would then be used in app/design/frontend/vendor/theme/Magento_Theme/templates/html/header/logo.phtml.

By default, I believe it uses $this->getUrl('') to point to the store's home page.  However, I need this to point to an external URL, and the URL depends on which environment the site is running on (i.e. dev, staging, prod).


texts:
Just activated Varnish cache on my magento site and started receiving this error (it worked just fine when Varsnish wasn't active):

Fatal error: Call to a member function getImageUrl() on a non-object in /home/admin/public_html/golulo.es/app/design/frontend/golulo/default/template/page/html/page_header.phtml on line 4

Here is the content from page_header.phtml

<?php
    $_helper    = Mage::helper('catalog/output');
    $_category  = Mage::registry('current_category');
    $_imgUrl = $_category->getImageUrl();
?>
<?php
    if (!$_imgUrl){
?>

<?php
    }
?>

        <div class="container row" style="<?php if($_imgUrl): ?>background-image: url(<?php echo $_imgUrl; ?>);<?php endif; ?>">

<?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?>

                    <?php echo $this->getChildHtml("breadcrumbs"); ?>

If I remove $_imgUrl for example, I get the same error with getName.

I'm trying to find any working solution, but I can't find anything that would help.

Any ideas?
Thanks,


texts: How to change Gender label and value in back end? Instead of Gender I need Test. Drop down value yes or No


texts: magento 2 Admin Change grid data based on the selected options via ajax

texts:
I have an admin form inside which I have added a dropdown and one grid  with UI component
I want to change the grid data or need to apply filers to grid collection based on the selected value inside the dropdown
Ex. if I select option 1 then the grid will show data depending on that option and if I select option 2 then data is based on that value
how can I do this ?
Your help is appreciated


texts:
I have several questions about the 2 ways I can see of installing magento 2 and hopefully this will help me solve my confusion over this subject matter

My reference is http://devdocs.magento.com/guides/v2.1/install-gde/bk-install-guide.html

What are the pros/cons of installing via the command line instead of using a clone from github?
If I install via command line then does that mean that I can't use composer to update/install extensions?


texts: Tracking Url & Number for individual order item

texts: I am facing some issues in Shipping email. Now I want to show the  shipping details like Tracking Url, Tracking number to be shown against each order line in shipping email. In theory each line could be shipped via a different carrier. How Can I achieve this in the code.


texts:
I have installed MailChimp extension from reference link but getting errors below :-

https://marketplace.magento.com/mailchimp-mc-magento2.html

  Warning!file_get_contents(/var/www/html/austinsdiving/app/code/Ebizmarts/MailChimp/etc/module.xml):
  failed to open stream: Permission denied

Friontend:-

https://prnt.sc/jfnek2

Compile Time:-

  [ReflectionException]              Class Mailchimp does not exist

https://prnt.sc/jfnkjl

Please help me


texts: How to edit price function html in magento?

texts:
Currently price showing like:

$589.00

i want currency to bit little than other fonts and i should be superlative?
like:

$589.00

From where do i get that file?


texts:
I would like to add some content to the footer.

I followed few tutorials and was able to edit (remove some and add some others) default footer links by editing the file:

website-root/app/design/frontend/MJ/theme/Magento_Theme/layout/default.xml

And I was able to add extra content to footer from:

Admin: Content > Blocks > Add New Block

and then reference that block from a Widget. The Widget was set up to appear in the container: Page Footer

and it showed to right under subscribe button as seen in the image above.

I tried changing the container to Page Footer Container

but it showed just under existing links.

I still have a lot to learn while customizing this theme, therefore, I would appreciate any insights you could provide into how to handle this in Magento.


texts:
I want to search by SKU but suggestions don't appear.

For example, most SKU start by "600", the ajax request made by Magento 2.x is:

  search/ajax/suggest/?q=600&_=1571930826272

The result is

  {}

SKU field is searchable and active, why does it return 0 results?


texts: Sharing Customer and Session between 2 sites

texts:
I am very new to magento and i have two sites  abc.com , bcd.com hosted on different server.
Now i want when user will do checkout on bcd.com , it will redirect to abc.com and user can make payment. after sucess payment it will redirect back to bcd.com.
Can any body tell me how to achieve this result

Thanks


texts: difference between event and process in creating custom Index in magento?

texts:
Can someone please explain difference between Process and Events when creating a Custom Index in Magento?

When are the functions _processEvent(Mage_Index_Model_Event $event), _registerEvent(Mage_Index_Model_Event $event), and matchEvent(Mage_Index_Model_Event $event) are called and how to use them? thanks


texts:
I want to change favicon icon while access pdf/image file from media path.I actually i already tried to change from admin and also update icon in media and skin folder but favicon icon not changed in media files.Also  tried to change in root directory.

Please help me to solve this.


texts: Magento 2 I want to update cart quantity using ajax, how can I do this?

texts:
I have a controller, from where I can send cart quantity. And I used ajax call to fetch data

require([
    'jquery'
], function($){
    jQuery.ajax({
        url: "/mycart/cartcount",
        type: "POST",
        data: "",
        success: function (res) {
            jQuery(".cart_qty").html(result);
        }
    });
});

My question is, how can I get cart quantity in my controller?


texts:
I am using CE 1.7.0.2 all indexes stuck at processing since 24 hours. When try to do indexing manually throw an error:

  xxx Index process is working now. Please try run this process later

As per https://stackoverflow.com/questions/14127430/magento-indexes-issue-cant-reindex
I always use SSH to do indexing. I deleted all files under \var\locks, DIR permission is 777 But when tried indexing one by one then throws same error and locks files regenerate again.

Please tell how to fix this?


texts:
I am newbie in Magento 2 and i created an event and observer
I got fatal error

  Fatal error: Call to a member function getAllVisibleItems() on null

here is my events.xml

    <?xml version='1.0'?>
    <config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework/Event/etc/events.xsd'>
       <event name='checkout_onepage_controller_success_action'>
            <observer
                    name='Pulsestorm_HelloWorldMVVM_HelloWorld'
                    instance='Pulsestorm\HelloWorldMVVM\Observer\HelloWorld'
            />
        </event>
    </config>

and here is my observer

<?php

namespace Pulsestorm\HelloWorldMVVM\Observer;

use Magento\Framework\Event\ObserverInterface;

class HelloWorld implements ObserverInterface
{
    /**
     * @var ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_objectManager = $objectManager;
    }

    /**
     * customer register event handler
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
    $order = $observer->getEvent()->getOrder();
    $items =$order->getAllVisibleItems();
    $productIds = array();
    foreach($items as $item) {
        $productIds[]= $item->getProductId();
    }

    //custoemr id
    $customerId = $order->getCustomerId();
    echo"<pre>";print_r($customerId); exit;

    }

Mainly i want to get all the data of customer and product.


texts: How do I retrieve a product using either the REST or SOAP APIs?

texts:
An external utility needs to retrieve products from Magento by SKU--either one at a time or in batches, ideally returning the product with all attribute values, photo URLs, categories, etc.

So far I haven't found a direct, simple reference for doing a "hello world" product query against one of the stock APIs--so even that would be useful.  Or, given the need to retrieve a "full" product would I just be better served writing my own endpoint to retrieve and serve the required info?


texts: Magento 2 Get admin user collection with specific role name

texts:
I have a custom module which has all the admin users listed. Now I want to list admin users with specific roles.

In my grid collection code it has below code which get all the users:

$collection = $this->_userFactory->create()->getCollection();
    $table = $collection->getTable('authorization_role');

    $collection->getSelect()
    ->join(['role' => $table], 'main_table.user_id=role.user_id');
    $collection->addFieldToFilter('role.role_name', ['nin' => ['Administrators', 'XYZ']]);

    $this->setCollection($collection);

    parent::_prepareCollection();

    return $this;

I want to show all users which do not have these 2 roles "Administrator, XYZ".

How could I make join in the collection?

Thanks!


texts: Can't add products to shopping cart / cart keeps loading Magento 2

texts:
I recently copied a website over to another host by using the import tool.

After this I don't seem able to add items into my shopping cart.

The button keeps saying loading and the Ajax loader shows near the shopping cart Icon. I checked the ajax call and it shows this as responsetext:

array(0) {↵}↵

With a statusText "parse error".

I am using a fairly unmodified magento ver. 2.2.4. And the shopping cart is working correctly on the original site


texts: Is there any disadvantage ior is it discouraged to use proxy on factory class? I am extending from some Customer\Address controller and it has some dependencies which I won't use. I want to replace by proxy \Magento\Customer\Model\Metadata\FormFactory.


texts: Is there any way to get a value of an attribute on the up-sell list with not active "Used in Product Listing" option?

texts: I want to get a value of the attributes on the up-sell list but only ones that have active "Visible on Product View Page on Front-end" option and not active "Used in Product Listing" option


texts: Loading custom phtml file in an existing template issue in adminpanel

texts:
I want to add some js code for the Associate to website field when you create a new customer.
This is the xml responsible for loading that dropdown with the stores:

<scope_switcher>
        <block type="enterprise_customer/adminhtml_form_renderer_fieldset_element" name="fieldset_element_renderer" template="enterprise/customer/form/renderer/fieldset/element.phtml" />
        ......
</scope_switcher>

So i created my own module and tried the following in the my layout xml:

<scope_switcher>
        <reference name="fieldset_element_renderer">
            <block type="core/template" name="mynamespace_mymodule_fieldset_element_renderer" template="mynamespace_mymodule/enterprise/customer/form/renderer/fieldset/element.phtml" />
        </reference>
</scope_switcher>

and in my new template (element.phtml) , I want to add my js code. The fact is that my new template it is not loaded. The path is correct. Any idea what did I do wrong ? thx


texts: Magento 1.9.2.2: Can't login into admin panel

texts:
I'm developing on a shop, local, and starting it with

php -S localhost:3000

http://localhost:3000 works for me.

But when I want to login into backend, it keeps displaying only the login page.
I also created a new admin user using n98-magerun, I've deleted all cookies, and still can't login...

The web/unsecure/base_url and web/secure/base_url in core_config_data are also set to http://localhost:3000.

What could be the problem?


texts: Magento 2 API, catalog price rule is not applied

texts:
The catalog price rule is working in frontend. But when we get the product from REST API, we are getting the original price only.

Example:
Product price is 34, we were created catalog rule with 10% for all products, in frontend we are getting both prices 30.26 and 34. But from api, we are getting only 34.

Please help.

API EndPoint:

  http://localhost/magento/rest/default/V1/products/24-MB01

Partial Response:
{
  "id": 1,
  "sku": "24-MB01",
  "name": "Joust Duffle Bag",
  "attribute_set_id": 15,
  "price": 34,
  "status": 1,
  "visibility": 4,
  "type_id": "simple",
  "created_at": "2017-01-10 07:50:47",
  "updated_at": "2017-01-10 07:50:47",
  "extension_attributes": [],
  "product_links": [],
  "options": [],
}


texts:
I am trying to add an animation library called Sal, built on pure Javascript (Does not rely on jQuery). Maybe I am missing something, but I followed the instructions on adding via require-config, and I am getting a sal is not defined error.
I have also tried just adding the js file via default_head_blocks.xml
My require-config.js

var config = {
    paths: {
        'sal': 'js/sal'
    },
    deps: [
        "js/script",
        "js/main"
    ]
};

My main.js

define(['sal'], function(){
  "use strict";
  sal();
  console.log(" ====== main.js is loaded====== ");
});


texts: Unable to change the default image for products in Magento 2.1.8

texts:
We have a site which is currently running on Magento 2.1.8 and are running into problems with image changling within the catalog. If we make a change to the base, small, thumbnail image for a product it does not seem to be reflected on the frontend. We have tried various admin functions to resolve but nothing seems to have an impact.

To recreate this we go to a product in admin and upload a new image. Click the image we just added and select the options for this to be Base, Small, Thumbnail, Swatch. Click save and on the frontend browse to the catalog and see that the image for the product is unchanged.

Clear cache from admin has no impact, running a cache clear from CLI does not have an impact. Even running a rebuild of the image cache does not seem to resolve the issue. We have tried restarting Apache, Varnish and disabling CDN and are out of things to try.

Is this a known issue in 2.1.8 or are there any other ideas on what might be holding that now out of date reference view of the product


texts: magento 2 - custom router throws Front controller reached 100 router match iterations error

texts:
I am trying to build a module that has a custom front-end router on magento 2.1.12. I am following magento doc & I am using the inchoo custom router example.

The problem is the route (MY-SITE/matinteg/orders) throws

  Front controller reached 100 router match iterations

error when ever I try to reach it. I tried to flush & remove cache, cache_page, progress, ... so it doesn't seem to be mis-configured or problematic cache. I also upgrade, compile, deploy & flush cache so many time. But there was no luck.

The $request returns a complete object and everything seems to be true, but still I get the error.

I have

  vendor_module/Controller/Router.php

public function match(\Magento\Framework\App\RequestInterface $request){
    if($request->getModuleName() == 'cms'){
        $identifier = trim($request->getPathInfo(), '/');
        if(strpos($identifier, 'matinteg/orders') !== false) {
            /*
             * We must set module, controller path and action name for
               our controller class(Controller/Test/Test.php)
             */
            $request->setModuleName('cms')->setControllerName('integration')->setActionName('integration');
        } else {
            //There is no match
            return;
        }
        /*
         * We have match and now we will forward action
         */
        return $this->actionFactory->create(
            'Magento\Framework\App\Action\Forward',
            ['request' => $request]
        );
    }
}

The rest of the files are pretty identical to inchoo sample. I have

  vendor_module/Controller/Integration/Integration.php

  vendor_module/etc/frontend/routes.xml

I tried to hire the solution in this stack but it was not helpful either


texts:
I'm wondering if there is some possibility to disable UI (or Frontend, or Theme) part on Magento?
The problem:
I installed magento on subdomain server.example.com and use it as headless cms. So all I need from server.example.com - it's admin panel, graphql endpoint and media/file server.
Also I have a react app on domain example.com and it's used for UI/Frontend as client-side application.
So, is there any chance to disable all redundant functionality on magento (like html rendering, routing, etc.)?
Thanks in advance.


texts: Unable to implement jQuery on shipping method selection : Magento2

texts:
I want hide and show custom message on radio button selection of shipping method on checkout page , but jQuery is not working in that section due to knockoutjs.
Anyone have any idea for that how to implement custom jquery on shipping method selection?

here is my jquery code :

    <script type="text/javascript">
    require(["jquery"], function($) {
        jQuery(document).ready(function(){
   jQuery('.radio').click(function() {
    alert("selected shipping");
   });

        });
    });
</script>


texts:
I'm not unfamiliar with a Magento 503 error. However, for a client I'm getting this error without any markup to the page as well and the full error reads:

  The server is temporarily unable to service your request due to
  maintenance downtime or capacity problems. Please try again later.

  Additionally, a 503 Service Unavailable error was encountered while
  trying to use an ErrorDocument to handle the request.

Normally I would start looking for the "maintenance.flag" file, empty my cache, deactivate and clear compiler or see if there have been any new extensions installed. I've done all this just to be sure but especially the last sentence gives me the idea this is a problem outside of Magento. I'm also not able to access the backend as this throws the same 503 error.

What I've also done is uploading a ".html" file which is returned normally. Uploading a ".php" to the root is NOT rendered and returns the 503... What does this tell me?

What steps other that described can I take to be more sure?


texts: How To Make An Admin Form For Multiple Collection Records Editing At Once?

texts:
I have a Magento standard admin form and it works fine for editing one collection record, but I want to make it so I can edit multiple collection records at once.

My idea was to do a for loop where it adds the fields:

for($i=1;$i<=$productsInOrder;$i++){

    $fieldset->addField('start_date' . $i

and add indexes to the field names, but I don't know how to properly modify the collection query and setting form data to account for the new indexes. The table I am pulling records from and modifying is a simple custom table with extra order info in it for each product.

Any ideas? Has anyone done this before and can share their code?


texts:
I am new in magento. I created a custom observer to trigger on the event sales_order_place_before, but its not working.

Here's my code:
app/etc/modules/CustomPriceUpdate_Checkout.xml

<?xml version="1.0"?>
<config>
    <modules>
        <CustomPriceUpdate_Checkout>
            <codePool>local</codePool>
            <active>true</active>
            <depends>
                <Mage_Catalog />
            </depends>
        </CustomPriceUpdate_Checkout>
    </modules>
</config>

app/code/local/CustomPriceUpdate/Checkout/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
    <CustomPriceUpdate_Checkout>
        <version>0.0.1</version>
    </CustomPriceUpdate_Checkout>
</modules>
<global>
    <models>
        <myCustomPriceUpdate_Checkout>
            <class>CustomCheckout_Event_Model</class>
        </myCustomPriceUpdate_Checkout>
    </models>
    <events>
        <sales_order_place_before>
            <observers>
                <modify_product_price>
                    <type>singleton</type>
                    <class>myCustomPriceUpdate_Checkout/observer</class>
                    <method>update_price</method>
                </modify_product_price>
            </observers>
        </sales_order_place_before>
    </events>
</global>
</config>

app/code/local/CustomPriceUpdate/Checkout/Model/Observer.php

<?php
class CustomCheckout_Event_Model_Observer{

  public function update_price($observer){
    Mage::log("Order is placed");
  }
}

When I check the system.log file, I am seeing following error:

  Warning: include(CustomCheckout/Event/Model/Observer.php): failed to
  open stream: No such file or directory  in /var/www/html/lib/Va$

  Warning: include(): Failed opening
  'CustomCheckout/Event/Model/Observer.php' for inclusion
  (include_path='/var/www/html/app/code/loc$

Can anyone please suggest, what's wrong in the code ?


texts: Why does setup:di:compile fail on PHP 7 but not on PHP 5.6?

texts:
Running: Ubuntu 16.04 LTS (also happens on Debian Stretch)
Magento 2.1.1
PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )

Magento installed and DB set up etc.

I run:

rm -rf var/di/* var/generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/*
chmod 777 var -R
chmod 777 pub -R
php -d memory_limit=2048M bin/magento setup:di:compile

Then I get the error:

Compilation was started.
Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 44.0 MiBPHP Fatal error:  Cannot use Cminds\Marketplace\Model\Fields as Fields because the name is already in use in /var/www/html/app/code/Cminds/Marketplace/Controller/Adminhtml/Suppliers/Deletecustomfield.php on line 7
Segmentation fault

On PHP 5.6.27 (cli) (built: Oct 23 2016 11:47:58) I do not get this error and compilation happens successfully.

Does anyone know why the PHP version would cause this?
Adding -vvv does nothing (as far as I can tell, no extra logging in /var/log), is there a way I can get more information relating to the error?

Any help would be much appreciated


texts: Magento 2 | Join table catalog_product_entity_tier_price to collection

texts:
I'm trying to filter my product collection by tier price.
I currently have this code but it doesn't work and it returns error:
protected $_productCollectionFactory;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        array $data = []
    )
    {
        $this->_productCollectionFactory = $productCollectionFactory;
        parent::__construct($context, $data);
    }

public function getProductCollectionTot()
    {
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');

        $collection->getSelect()->join('catalog_product_entity_tier_price as tier', 'price_index.entity_id = tier.entity_id');

        $collection->addFinalPrice()
              ->addMinimalPrice()
              ->getSelect()
              ->where('tier.all_groups = 0')
              ->where('price_index.Tier_price < price_index.price');

        return $collection;
    }

How can I filter my collection by tier price?


texts: Make Magento 2 Product Attribute Read-Only

texts:
In Magento 1, we used the lockAttribute($attributeCode) method from a catalog_product_edit_action observer, and it prevented the admin user from editing that particular attribute. See Read-Only Product Backend attribute.

Magento 2 has the same lockAttribute method in Magento\Catalog\Model\AbstractModel. However, the UI for the attribute is no different after calling this method.

I also tried it on catalog_product_save_before, and it still allowed me to apply a new value to the attribute.

Vendor/Module/Observer/Lock.php

namespace Vendor\Module\Observer;

class Lock implements \Magento\Framework\Event\ObserverInterface
{
    /**
     * Observer to catalog_product_save_before to lock attributes.
     *
     * @param \Magento\Framework\Event\Observer $observer
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $product = $observer->getEvent()->getProduct();
        $product->lockAttribute('my_custom_attribute');
    }
}

Vendor/Module/etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <!-- <event name="catalog_product_save_before"> -->
    <event name="catalog_product_edit_action">
        <observer name="test_lock_attributes" instance="Vendor\Module\Observer\Lock"/>
    </event>
</config>


texts: Color Swatch and Price Filter not showing in magento 2.1.7

texts:
I am new to Magento 2.1.7. following set to create the category product listing page.

Create the Root category and sub category In display setting  Anchor value is Yes.
Than create the product attribute and assign to attribute set.In the
each attribute I give the following options:

  Use in Filter Options value is Yes.
  Use in Search value is Yes.
  Use in Layered Navigation value is Filterable (with results).
  Use in Search Results Layered Navigation value is Yes.
  Visible on Catalog Pages on Storefront value is Yes.
  Used in Product Listing value is Yes.
  Used for Sorting in Product Listing value is Yes.

Create the configurable product with select the option attribute set.
Then create the page to list the products.In that page

  Design -> Layout is 2 columns with left bar
  Design -> Layout Update XML

<referenceContainer name="sidebar.main">
<block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" before="-" template="layer/view.phtml">
<block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalog.navigation.state" as="state" />
<block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalog.navigation.renderer" as="renderer" template="layer/filter.phtml"/>
</block>
</referenceContainer>
<referenceContainer name="content">
<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
<container name="category.product.list.additional" as="additional" />
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
<block class="Magento\Framework\View\Element\Template" as="default"/>
</block>
<block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="category.product.addto" as="addto">
<block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
 name="category.product.addto.compare" as="compare"
 template="Magento_Catalog::product/list/addto/compare.phtml"/>
</block>
<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
<block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
</block>
<action method="setToolbarBlockName">
<argument name="name" xsi:type="string">product_list_toolbar</argument>
</action>
</block>
</referenceContainer>

For Price Filter

Stores -> Configuration -> Catalog -> Layered Navigation

  Display Product Count value is yes
  Price Navigation Step Calculation value is Manual
  Default Price Navigation Step value is 0.5.
  Maximum Number of Price Intervals value is 2

I have followed the all steps but the color swatch and price filter are not showing.In Product details page color swatch is showing.
Anyone helps me.


texts: I can't login to Magento after changing the base url. Website is gone!

texts:
How do I fix my Base URLs so I can access my Magento site?

I found a similar question that was already answered. I followed the steps but I still can't recover the website or get into Magento backend.
I followed the steps and changed the secure and unsecure base url back to their original value. I cleared every var/cache and var/session folders as well. I still see this when trying to access the backend site:

Not Found

The requested URL /index.php/admin was not found on this server.

Help would be VERY much appreciated.


texts: Order is not updated to complete after a shipment is created in M1

texts:
I am running a cronjob to create shipments.

Method 1, shipment is created but order is not updated to complete:

$shipmentItems = [];
$comment = '';
/* @var $item Mage_Sales_Model_Order_Item */
foreach ($order->getAllItems() as $item) {

    $comment .= trim("{$item->getSku()}: {$item->getQtyOrdered()}\r\n");

    $shipmentItems[$item->getId()] = $item->getQtyOrdered();
}

Mage::helper('ffm_fulfillment/api')->log("With items {$comment}", Zend_Log::INFO);

$shipmentId = Mage::getModel('sales/order_shipment_api')->create(
    $order->getIncrementId(),
    $shipmentItems,
    $comment,
    false, // email
    false // include comment in email
);

Method 2: Shipment is created and order is updated to complete:

$itemQtys = [];$comment = '';
foreach ($order->getAllItems() as $orderItem) {
    if ($orderItem->getQtyToShip() && !$orderItem->getIsVirtual()) {
        $comment .= trim("{$orderItem->getSku()}: {$orderItem->getQtyOrdered()}\r\n");
        $itemQtys[$orderItem->getId()] = $orderItem->getQtyToShip();
    }
}
$shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($itemQtys);
$shipment->register();
$shipment->addComment(
    $order->getIncrementId(),
    $itemQtys,
    $comment,
    false, // email
    false // include comment in email);
);
$order->setIsInProcess(true);
Mage::getModel('core/resource_transaction')
    ->addObject($shipment)
    ->addObject($order)
    ->save();

My question is , why by using method 1 order is not updated to complete ?

Thank you


texts: Magento 2 Cart Price Rules for Grouped Product

texts:
I need to create a cart price rule that will apply to a customers basket when they add a grouped product. We sell 'boxes' of items as a grouped product and want to add a free item to the order for certain boxes.
Is there a way to achieve that either as standard or by modifying Magento? I tried adding a rule based on the SKU of the grouped product but that doesn't seem to be supported?


texts: Override Magento_Sales::email/items/shipment/default.phtml Template (Magento 2)

texts:
I am trying to override Magento_Sales::email/items/shipment/default.phtml
Here is my layout file
app/code/Mod/Sales/view/frontend/layout/sales_email_order_shipment_renderers.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom">
    <body>
        <referenceBlock name="sales.email.order.shipment.renderers">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Mod_Sales::email/items/shipment/default.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Added phtml in
app/code/Mod/Sales/view/frontend/templates/email/items/shipment/default.phtml

But file did not override the call still comes into vendor file.
Any thoughts what's missing ?


texts: Magento2 does not load completely on windows(XAMPP)

texts:
I have installed magento2 on windows 10 machine using XAMPP. I am able to access the front end but when opens admin page it does not load successfully thus I cannot access the left side menu items(for example, magento2 does not respond when I click catalog, content etc).

I found following error message on chrome debugger panel


texts: Toolbar.php collection filtering using getCollection and addCategoryFilter not working

texts:
I am using Magento 1.9.3.6 CE

I want to add a select dropdown on the toolbar of product lists on category pages to filter the collection by a subcategory. (sidenote: I can't use the normal catalog navigation to filter for other reasons).

I extended Mage_Catalog_Product_List_Toolbar and created a function for getting the count of child categories.

class Namespace_Catalog_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
{
    public function getCategoryCount($childCategory) {
        $count = $this->getCollection()->addCategoryFilter($childCategory)->getSize();
        return $count;
    }
}

But when I call this function in the block, it returns the count of the current category, not filtered by the child category.

The child category is loaded by $childCategory = Mage::getModel('catalog/category')->load($child->getId());.

Here is the SQL of $this->getCollection()->getSelect();

SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '5' AND cat_index.is_parent=1 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 ORDER BY `cat_index`.`position` ASC LIMIT 16

Difference to below is here:

...
INNER JOIN `catalog_category_product_index` AS `cat_index`
ON cat_index.product_id=e.entity_id
AND cat_index.store_id=1
AND cat_index.visibility IN(2, 4)
AND cat_index.category_id = '5'
AND cat_index.is_parent=1
...

Here is the SQL of $this->getCollection()->addCategoryFilter($childCategory)->getSelect();

SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '61' INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 ORDER BY `cat_index`.`position` ASC LIMIT 16

Difference to above is here:

...
INNER JOIN `catalog_category_product_index` AS `cat_index`
ON cat_index.product_id=e.entity_id
AND cat_index.store_id=1
AND cat_index.visibility IN(2, 4)
AND cat_index.category_id = '61'
...

The SQL is different, so why is it giving me the same count regardless...? (There are definitely not the same count of products in any of the subcategories).

Thanks in advance.


texts: Magento 2 send order & invoice email manually

texts:
I tried to disable magento 2 send email order and invoice automatically (after place an order and invoice an order) by disable send email in   configration Store > Configuration > Sales > Sales Emails. But when i tried to send manually by clicking send email button or do it programmatically it won't send the email, unless i enable send order email in configuration again.

programmatically

$order = $objectManager->create('\Magento\Sales\Model\Order')
                           ->load(225);
      $objectManager->create('Magento\Sales\Model\OrderNotifier')->notify($order);


texts:
I have custom module field code is bellow for wysiwyg field:-

 $wysiwygConfig = $this->_wysiwygConfig->getConfig(['tab_id' => $this->getTabId()]);
    $fieldset->addField(
                'news_content',
                'editor',
                [
                    'name' => 'news_content',
                    'label' => __('Long Description'),
                    'title' => __('Long Description'),
                    'style' => 'height:11em',
                    'required' => true,
                    'disabled' => $isElementDisabled,
                    'config' => $wysiwygConfig
                ]
            );

when i upload image in this field with content it only shows content and image is not come with proper tag as bellow:-

test

so there is a question that content filter we used in 1.9.X.X is not in magento 2.0.2.

how can i get image and description from wysiwyg editor with default filter to display image with content.


texts: Magento 2 Order / Shipment Emails From Address Suddenly Apache / apache@localhost

texts:
I have recently updated to 2.2.4 and made a few minor changes however have just noticed that order emails are now sending with the wrong from address and is not set as per settings in Store -> Configuration -> General -> Store Email Addresses as I believe normally sets this.

Header shows like below:

From: Apache <apache@server.co.uk>
Return-Path: apache@server.co.uk

However previous headers and the current live site set this correctly and am unsure why this has suddenly started. Emails sent from forgotten passwords works fine and from what I can tell this is only effecting the order and shipment emails.

I have tried debugged this through about a maze of files all the way down to Magento\Framework\Mail\Template\TransportBuilderByStore and everything seems fine back to there.

The $this->message->setFrom($result['email'], $result['name']); seems to be correct and $result['email'] and $result['name'] are correct at this stage however the from address is not set.

$this->message uses the magento\Framework\Mail\Message class which just extends Zend_Mail for the setting of the from address so am unsure what could go wrong at this stage considering the variables sent to the function look fine.

Forgotten password however does not seem to use the TransportBuilderByStore so will try and figure out what is different for forgotten password emails.

I can see a similar issue here: https://github.com/magento/magento2/issues/6146 however this is very old. Has anyone else had an issue with this recently since updating? Why would this go wrong and how can I fix?

For now my best bet is just setting the from address via vhosts for each of the multi stores like below however would like to find out why this is happening?

php_admin_value sendmail_path "/usr/sbin/sendmail -fsales@domain.co.uk  -F 'Sales Department <sales@domain.co.uk>' -t