texts: How to display custom attribute in related product in related.phtml

texts:
I need to display custom attribute in related product.

I have tried get value of custom attribute in related product from related.phtml file.

app/design/frontend/base/default/catalog/product/list/related.phtml file.

But not getting print custom attribute. My custom attribute name is "testattr".

 foreach($this->getItems() as $_item): ?>

// Start tried Displaying custom attribute

echo "Testattr::" . $_item->getTestattr();

// End tried Displaying custom attribute

                <?php if(!$_item->isComposite() && $_item->isSaleable()): ?>
                    <?php if (!$_item->getRequiredOptions()): ?>
                        <input type="checkbox" class="checkbox related-checkbox" id="related-checkbox<?php echo $_item->getId() ?>" name="related_products[]" value="<?php echo $_item->getId() ?>" />
                    <?php endif; ?>
                <?php endif; ?>

                    <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />

<a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?>

                        <?php echo $this->getPriceHtml($_item, true, '-related') ?>
                        <?php if ($this->helper('wishlist')->isAllow()) : ?>
                            <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>
                        <?php endif; ?>

        <?php endforeach ?>

Any one can help me? i need to display custom attribute value in related product right side sidebar in default magento.


texts: Magento 2 Layered Navigation Not Working

texts:
I'm using Mageplaza Layered Navigation, with Porto theme for Magento 2 CE.
The problem is that when I select any filters in the product list page, it keeps displaying all the products irrespective of the filters applied.

Although, on the top it shows the message with correct number of products (x items found) as per applied filter.

I ensured Mageplaza Layered Navigation module is enabled, tried clearing cache, re-indexing etc but nothing worked.

Magento Version : 2.0.2
Porto Version : 2.4.2.1

Any suggestions would be appreciated.


texts: Magento 2 : Add discount and tax in order programmatically

texts:
I used below link to place an order, but in that, I cannot get any solution. how to add the tax or discount in order so anyone has done this thing?

please help to solve this issue.

http://www.blogtreat.com/programmatically-create-new-order-in-magento-2%EF%BB%BF/


texts:
I've 2 websites UK (default) and IN . I'm using PHP geo-location library to re-direct customers to Indian website based on their IP which is working fine on frontend.

$geoipPath = 'lib/geoip/geoip.inc';
require_once($geoipPath);
$gi = geoip_open("lib/geoip/GeoIP.dat",GEOIP_STANDARD);
$ip = $_SERVER['REMOTE_ADDR'];
$country_code = geoip_country_code_by_addr($gi, $ip);
if(strtoupper($country_code) == "IN"){
    header('Location: http://www.example.com/in/' . $_SERVER['REQUEST_URI']);
}
else {
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
    $app = $bootstrap->createApplication('Magento\Framework\App\Http');
    $bootstrap->run($app);
}

Due to above configuration, admin link is not working.

How I can check in root index.php file, if it's an admin url so that it goes to my else statement?


texts: Set custom options programmatically in loop

texts:
I am about to import a product via script and like to set several custom options for this product.

I build an array with the specific data:

$option = array(
    'option1' => array(
        'title' => 'title',
        'type' => 'drop_down',
        'is_require' => 0,
        'sort_order' => 1,
        'values' => getOptions('option1')
    ),
    'option2' => array(
        'title' => 'title',
        'type' => 'checkbox',
        'is_require' => 0,
        'sort_order' => 2,
        'values' => getOptions('option2')
    ) ...

Now I try to set the custom options in a loop:

foreach ($option as $key => $val) {
    $product->setProductOptions(array($option[$key]));
    $product->setCanSaveCustomOptions(true);
}

But this only saved the last option in the loop, so the other ones will be overwritten.

Could you help me out what I am missing?


texts: Best practice to set default store : StoreManager or Emulation?

texts:
Context :
I'm coding a lot of CLI commands and I noticed most of the time if I don't set what store I'm operating on, it will counter-intuitively be set to the first non-global store. Since more often than not I need to operate on the global store (aka \Magento\Store\Model\Store::DEFAULT_STORE_ID) I have begun setting the current store at the beginning of my scripts.

As far as I know there are two different ways to set the current store in Magento 2 : One is using the \Magento\Store\Model\StoreManager and the other one is using \Magento\Store\Model\App\Emulation.

Question :
Which method is considered best practice for environment initialisation?

Thank you guys. :)


texts: Magento 2 : Import product from csv configurable product error

texts:
I am working on Magento 2.1.3 product import with CSV.

I am getting a error while using following CSV file.

download csv

Error is "General system exception happened"


texts: how can i customize the message inside addError('text');

texts:
i have a function like this

public function triggerErrorMessage()
{
    $sessionCheckout = Mage::getSingleton('checkout/session');
    $sessionCheckout->addError('An error occurred during your transaction.');
}

how can i customize the text "An error occurred during your transaction" without changing the code, is this translateable in locale?


texts: Magento 1.9 - how to get single product stock data by id?

texts: How to get all data about the product having id including stock status and quantity?


texts: "Only 0 Left" message has suddenly appeared after 2.4.2 upgrade

texts:
As wrote in the title, after I've upgraded from Magento 2.4.1 to 2.4.2 the message "Only 0 Left" has suddenly appeared in the product page (configurable product).
I checked in Stores->Configuration->Catalog->Inventory->Stock Options->Only X left Threshold and it's set to 0. I tried to set to -1 but nothing's changed.

Any solutions?


texts: What could be causing - Uncaught TypeError: validOptions[i].toLowerCase is not a function?

texts:
I am trying to add some additional jQuery functionality to Magento but my script fails to run and in the browser console I notice this error:

Uncaught TypeError: Object function each(iterator, context) {
    var index = 0;
    try {
      this._each(function(value) {
        iterator.call(context, value, index++);
      });
    } catch (e) {
      if (e != $break) throw e;
    }
    return this;
  } has no method 'toLowerCase'

Here is my script

<script>
    jQuery(function() {

        jQuery('.temp-variable-price').on('input', function() {
            if(jQuery('input[class=temp-variable-price]').val()=="free")
            {
                jQuery('.temp-variable-price').val('FREE');
            }
        });

        var validOptions = [];
        validOptions.push("FREE");
        var x = 1;
        while (x<1000) {
            if (x<100) {
                validOptions.push(""+x+"p");
            } else {
                var y = x.toString();
                var z = y.split('');
                validOptions.push(""+z[0]+"."+z[1]+""+z[2]+"");
            }
            x++;
        }
        previousValue = "";

        jQuery('.temp-variable-price').autocomplete({
            autoFocus: true,
            source: validOptions
        }).keyup(function() {
            var isValid = false;
            for (i in validOptions) {
                if (validOptions[i].toLowerCase().match(this.value.toLowerCase())) {
                    isValid = true;
                }
            }
            if (!isValid) {
                this.value = previousValue
            } else {
                previousValue = this.value;
            }
        });

    });
</script>

Its nice autocomplete and validate script for certain form fields, you can see a demo here

If anybody knows what this error means I'd be so grateful for an explanation of how to debug and fix this issue?


texts: Magento 2 - How to Change Shipping information in one page checkout - payment step

texts:
I created one shipping method for store pickup. Its working fine.

But i need to change the shipping information(i.e address) as store address but it should not affect the customer_address table data.

What exactly i need is to change the address before submitting shipping address from shipping method step to payment step.
In below picture shipping info should contains store address

I'm working in magento 2.26 version.

Thank you


texts:
I'm trying to install Alpaca theme following the documentation.
I've created my composer.json file under app/design/frontend/ben/gotheme/composer.json
{
  "name": "ben/gotheme",
  "description": "",
  "type": "magento2-theme",
  "require": {
    "snowdog/theme-frontend-alpaca": "2.19.*",
    "ben/gotheme-front-tools": "*"
  },
  "autoload": {
    "files": [
      "registration.php"
    ]
  }
}

My registration.php looks like this:
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(
    ComponentRegistrar::THEME,
    'frontend/ben/gotheme',
    __DIR__);

When I try to install the theme running the following command from mangeto root I get an error:
composer require ben/gotheme

The error:
[InvalidArgumentException]
Could not find a matching version of package ben/gotheme. Check the package spelling, your
version constraint and that the package is available in a stabili  ty which matches your minimum-stability (stable).

I'm unsure what's going here. Why is composer not finding my package? Is there something I'm missing?


texts: My Custom Module API Data not saving in magento 2

texts:
I have created a custom module (Blog) which contains a save() method, it is executed but values are not saved and it returns an empty object.

<?php
namespace Learning\Blog\Model\Resource;
use Learning\Blog\Api\Data\BlogInterface;

class BlogRepository implements BlogRepositoryInterface
{

  protected $blogFactory;

public function __construct
    (
    \Learning\Blog\Model\BlogFactory $blogFactory
    ){
     $this->blogFactory = $blogFactory;
    }

public function save(BlogInterface $blog){

        $blog_Data = $this->blogFactory->create();
        $blog_Data->save();
        return $blog_Data;
    }
}

Did I miss anything?


texts: Can't get Magento 1 adminhtml layout file to load

texts:
I was working on a large module and I couldn't get an adminhtml layout XML file to load. So I created a new test module to isolate the issue and I still can't get the layout file to load.

I don't think my layout file is loading because if I turn on developer mode and mess up my config.xml or my adminhtml.xml then I get errors. But if I mess up the XML in my layout file then there are no errors.

Here's my config.xml:

#File: app/code/local/TestBlue/MeLayout/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <TestBlue_MeLayout>
            <version>1.0.0</version>
        </TestBlue_MeLayout>
    </modules>

    <admin>
        <routers>
            <testblue_melayout>
                <use>admin</use>
                <args>
                    <module>TestBlue_MeLayout</module>
                    <frontName>me-layout</frontName>
                </args>
            </testblue_melayout>
        </routers>
    </admin>

    <adminhtml>
        <layout>
            <updates>
                <testblue_melayout>
                    <file>testblue_melayout.xml</file>
                </testblue_melayout>
            </updates>
        </layout>
    </adminhtml>
</config>

Here's my adminhtml.xml:

#File: app/code/local/TestBlue/MeLayout/etc/adminhtml.xml

<?xml version="1.0"?>
<config>
    <menu>
        <sales>
            <children>
                <testblue_melayout>
                    <title>Me Layout</title>
                    <sort_order>1000</sort_order>
                    <action>me-layout/adminhtml_index/index</action>
                </testblue_melayout>
            </children>
        </sales>
    </menu>
</config>

Here's my controller:

#File: app/code/local/TestBlue/MeLayout/controllers/Adminhtml/IndexController.php

<?php

class TestBlue_MeLayout_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

And here's the layout file that I don't think loads:

#File: app/design/frontend/mytheme/default/layout/testblue_melayout.xml

<?xml version="1.0"?>
<layout version="1.0.0">
    <default>
        <reference name="before_body_end">
            <block type="core/template" template="file.phtml"/>
        </reference>
    </default>
</layout>

Everything here works properly except I don't think that layout file at the bottom of my config.xml loads. In other words, if I click the new admin menu item under sales then I properly hit that indexAction() in the controller. But of course that page is blank and I want to put content there by using a layout file so that I can specify a .phtml file for that route but again I don't think the layout file is loading.

The layout file code that I put above is a copy of another layout file in the same directory that is currently successfully loading for a different module on the frontend(ie. the public facing site).

So how can I troubleshoot why this layout file isn't loading?

All I really want to do is put some content on this new admin route page. If I can't figure out this layout file loading issue, then what are some other options for displaying content on the page? Can I assign HTML to the layout right inside indexAction()?


texts: Is possible Identify accessed page before page 404?

texts:
I have a new Magento store (version 1.9.3.1), I have already checked all the links and all are working normally, however in Google Analytics there are many hits that are causing the 404 error, I wonder if there is any way to identify where these hits are coming from , If the Magento has some functionality for this...

See Google Analytics, the /pagina-nao-encontrada is page 404 that have 103 hits:

The important thing is where the error is coming from, if I succeed in some way, by session, by cookie, by htaccess, and then I could send to PHP page as a post and send an email myself, but that part I know How to do it, I just do not know how to identify where the error is coming from.


texts: Getting 'getLastRealOrderId' once order has been placed

texts:
Once an order is placed in my magento store I have a custom module so that i can save the order number into an external database table.

My custom module setup is:

Custom/ExternalOms/config.xml

So i hook into the sales_order_place_after event

    <?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Custom_ExternalOms>
            <version>0.0.1</version>
        </Custom_ExternalOms>
    </modules>
    <global>
        <models>
            <custom_externaloms>
                <class>Custom_ExternalOms_ExternalOms</class>
            </custom_externaloms>
        </models>
        <events>
            <sales_order_place_after>
                <observers>
                    <custom_externaloms>
                        <type>model</type>
                        <class>Custom_ExternalOms_Model_ExternalOms</class>
                        <method>exportToOMS</method>
                    </custom_externaloms>
                </observers>
            </sales_order_place_after>
       </events>
    </global>
</config>

Custom/ExternalOms/Model/ExternalOms.php

and run my function:

class Custom_ExternalOms_Model_ExternalOms extends Mage_Core_Model_Abstract
{
    public function exportToOMS()
    {
        $_order_number = Mage::getSingleton('checkout/session')->getLastRealOrderId();

        // remaining code..
    }
}

The code runs once the order has been placed correctly but this:

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

Is coming up empty


texts: Is it possible to pass a custom system variable to a value in an email template in Magento 2?

texts:
In Magento 2.3: I have created a custom system variable (System > Other Settings > Custom Variables) that contains a url. I'd like that url to be able to be used in a link in a {{trans}} block in an email template:
{{ trans 'You should click here' | raw }}
Unfortunately this does not get rendered properly - I've tried a couple of variations, but have been unable to come up with the proper syntax for this (without breaking apart the {{trans}} in to two {{trans}} blocks.
Does anyone know the syntax to be able to pass a system custom variable within a {{trans}} block?


texts: How to implement an "any" option for product attributes

texts:
I have a clothing store where all products have a size and color, and I want to add a new "make-your-own-shirt" product on the site. If someone wants to see all purple shirts on my site, they should see the tailor-made shirt in the search results because tailor-made shirts can come in any color.

This is a dumbed-down example. Note that right now, multiple colors and sizes of the same shirt are all standalone products.

I'm using ManaDev for filtering - but I'm not the one who set it up and know little about it.

I have a very ugly solution right now: my custom-made search page automatically adds the "any" value to filters, so that whenever you search for a shirt that is small and purple, you actually search for a product with size = small OR any and color = purple OR any. But this is quite hard to maintain and an ugly fix that is visible to the user. I'd rather fix this server-side. Is there any way to make such a value that matches any search filter?


texts:
On a successful trigger of Add to Cart button.

How we can get a modal like this picture?

Appreciate all your attention!


texts: Get Customer Telephone no after customer registration in magento 1.8.0

texts:
I call the observer i.e. customerRegisterSuccess function after successfull registration of customer.In this function I want to get email as well as telephone number of customer.Email successfully fetch by using function
$observer->getEvent()->getCustomer()->getEmail();
But, While fetching telephone number I face too much problems.I use below some function but all are not in use.
function are :
1.$observer->getEvent()->getCustomer()->getTelephone();
2.$observer->getEvent()->getCustomer()->getBillingAddress()->getTelephone();
3.$observer->getEvent()->getCustomer()->getMobileNumber();
4.$observer->getEvent()->getCustomer()->getPrimaryBillingAddress()->getTelephone();
All above function return NULL.Some function get error.
So, please let me know the perfect answer.The telephone no. field present in the address information section of registration form.


texts:
I have looked at this answer: Force an order to go to the status complete, but it doesn't apply to me. Due to a crash in our system we've lost an order that was further administratively taken care of.
Now I have created the order manually. Invoice and such has already been sent, so I don't want to do this. Instead I tried updating the order status in sales_flat_order, but this doesn't reflect in the admin panel. How can I solve this?


texts: Solved: Layered Navigation of Parent Categories

texts:
The layered navigation of the Child Categories it's working okay. The problem is with Parent Categories.

I'm trying to have the same filters on Parent Categories but i still can't solve it.

What I need on Parent Category Filter:

Shop by Color
Shop by Price
Shop by Material

What it's displaying now:

Shop by Category

On Child Categories it's been displaying okay.


texts: strict_types declaration must be the very first statement in magento 2.3.1

texts:
I have Magento 2.3.1. I am facing below error when I run command setup:di:compile.

  Fatal error:  strict_types declaration must be the very first
  statement in the script in
  vendor/magento/module-quote/Model/ChangeQuoteControl.php on line 8


texts: Magento2 : Quote Value in Observer Gets NULL

texts:
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="payment_method_is_active">
        <observer name="ComapnyName_ModuleNames_DisabledCcByPincode" instance="ComapnyName\ModuleName\Model\Observer\DisabledCcByPincode" />
    </event>
</config>

File Path : /app/code/CompanyName/ModuleName/Model/Observer/DisabledCcByPincode.phpDisabledCcByPincode.php

<?php
namespace CompanyName\ModuleName\Model\Observer;

use \Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Checkout\Model\Session;

class DisabledCcByPincode implements ObserverInterface
{
    protected $checkoutSession;

    public function __construct(
        \Psr\Log\LoggerInterface $logger,
        Session $checkoutSession
    )
    {
        $this->_logger = $logger;
        $this->checkoutSession = $checkoutSession;
    }
    /**
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(Observer $observer)
    {
        $result          = $observer->getEvent()->getResult();
        $method_instance = $observer->getEvent()->getMethodInstance();
        $quote           = $observer->getEvent()->getQuote();
        //$this->_logger->info($method_instance->getCode());
        /* Disable All payment gateway  exclude Your payment Gateway*/

        var_dump($quote); //This Value coming NULL

        $postcode = $quote->getShippingAddress()->getPostcode();

    }

}

I am not getting quote or any data except $resultvalue. I would like to get quote data in above observer event.

Any help appreciated.


texts: Remove Add to Cart button on select products

texts: I would like to remove the "Add to Cart" button on specific products so that I can add a get a quote button instead. Is there a way I can insert a script within a product to pull the button?


texts:
I am trying to print the log using logger method in magento 2, while printing i am getting 2 empty array brackets in the log. Can anybody say why it happens like this and how to remove those brackets?
sample log response
Coveolog.INFO: {"message":"Source with name 'dss-coveo_m2-integration-b2c-product-en_us' already exists.","errorCode":"INVALID_SOURCE_CONFIGURATION","requestID":"47abdd9f-0ae6-4ed4-a19f-c995d4e62f2c"} [] []


texts: Magento2 - Change position of wishlist on catalog-category view page

texts:
I want to change the position of Wishlist icon on the top of image .

Do I have to achieve this through xml or through css?

I tried through xml but I couldn't move it over the image.

Here is the screen shot:


texts:
I am trying to sort the items based on the order they were added to the cart (oldest at the top, each item added under that). Is there any logical method to the way cart items are sorted in Magento 1.5? I can't seem to find a pattern!

I've been trying to sort using this on /app/design/frontend/default/mytheme/template/checkout/cart.phtml

$cartitems = Mage::getModel('sales/quote_item')->getCollection()->setQuote($this->getQuote())->addFieldToSelect('updated_at')->addOrder('updated_at', 'asc');

$items = array();
foreach ($cartitems as $item) {
    if (!$item->isDeleted() && !$item->getParentItemId()) {
        $items[] = $item;
    }
}

And then looping though the items per usual...

<?php foreach($items as $_item): ?>
    <?php echo $this->getItemHtml($_item) ?>
<?php endforeach ?>

I also need to sort cart items on a mini cart that drops down when you hover over a cart link in the header. It's working great except the ordering.

$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();

I've tried a bunch of different ways to sort, and just when I think I have it, all I need to do is change the qty of one of the items and they are all out of order again.

Can someone please point me in the right direction? I have found a couple things to try but nothing seems to be working.


texts: Magento2 : Category List Page limited product view for a one category

texts:
I have a 5 or more categories. There is a specific category set for a 1-column-layout and another are as 2-column-left layout.

For a 1-column-layout category i want to show limited product like 6 product limit after that pagination will appear and same for second specific category show product 10 after that show pagination.

please see image.

In Layout Update Xml field add xml code for product limit.


texts: Add custom block below mage_catalog_block_product_price

texts:
I need to add a custom block below mage_catalog_block_product_price and show it on list.phtml (category page) and view.phtml (product page). (Magento 1.9.x)

I was trying to add to my local.xml

<catalog_category_default>
    <reference name="product_list">
        <block type="core/template" name="shippinginfo" template="mytemp/shipping.phtml" after="Mage_Catalog_Block_Product_Price" />
    </reference>
</catalog_category_default>

It is not working unfortunately.

Thanks.


texts:
I am installing Magento 2 on Bitnami WAMP Stack. However, soon after starting the installation it throws a list of errors and I am unable to fix this one:

  PHP Settings Check
  Your PHP Version is 5.6.20, but always_populate_raw_post_data = 0. $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1. If you need more help please call your hosting provider.

I have checked the php.ini but the always_populate_raw_post_data is already set -1.

I also ran php.info, it shows this:

Where's the problem?


texts: Duplicating Onepage Block to a Custom Page

texts:
anyone could give me a tips or any kind of possible solution or good approach in doing this?.

My objective is to make a custom page that has the same onepage block on it
(the step by step procedure until placing final order)(please see the image)

let us say, we have the original checkout/onepage, but i also want a duplicate that goes by checkout/customname that has the same onepage block.
is it possible?
if it is, what is the good approach to do it?

by the way, im fine with doing it using Action (checkout/onepage/customname) than of Controller(checkout/customname).

ps: if you are going to ask why make two, the answer is,because two different user will be accessing two different checkout page. why? I'm afraid I cant answer that.

Thanks! :)


texts: Magento 2.1.1 wrong price on product list for configurable product

texts:
We are using Magento2 version 2.1.1, and have problems by showing prices on product list pages.

We have many configurable products and each of them have some single products (different colors, sizes,...). Every special price has also defined special price date (from - to). Recently we found out, that after special price is expired, we still see special price on product list.

Even full reindex and clearing cache didn't help.

Thanks for help.


texts: Adding P or L (portrait or landscape) attribute for image in Magento 1.4.x

texts:
I would like to add a product attribute called orientation to the eav_attribute table, and add this attribute upon upload of a product image or a category image (not necessary for others but perhaps I can do that as well).  I want to be able to pull this information via data vs. waiting till I have the image to analyze the information.

I have two questions:

First - what is the best approach to this?  I have searched quite a bit but because of noise on terms like iOS and etc., I haven't found anything.  I am fairly new and want to do this "the Magento way".

Second - how would I read this attribute in my list.phtml file?


texts: magento system.xml  validate two parameter using same method

texts:
I have two system config fields like password and password confirm field.i need to validate both are same.
for this in my system.xml file i added <backend_model> note to both fields

 <backend_model>myextension/test</backend_model>

in my model folder i created Test.php class as below

class Mycomany_Myextension_Model_Test extends Mage_Core_Model_Config_Data
{

public function _afterSave()
    {
        $licence = $this->getValue(); //get the value from our config
        print_r($licence);
        die();

        return parent::_afterSave();
    }

}

EDIT

My system config values

<input id="filemaker_general_fburl" name="groups[general][fields][fburl][value]" value="test" class=" input-text" type="text">

<input id="filemaker_general_fbheight" name="groups[general][fields][fbheight][value]" value="123" class=" input-text" type="text">

but it only return one value instead of two.i don't know what is the issue?


texts: Can not make operation because store is not exists in SOAP api for Add to cart products

texts:
Can anyone guide how to solve below bug

'Can not make operation because store is not exists' in SOAP api for Add to cart products

I tried,

    $proxy = new SoapClient('http://localhost/magento1.9/magento/api/soap/?wsdl');
    $sessionId = $proxy->login('Aleena', 'teena1234');

    $quoteId = $proxy->call( $sessionId, 'cart.create', array( 'magento_store' ) );
    echo "<pre>";
    print_r($quoteId); exit;
    $arrProducts = array(
        array(
            "product_id" => "1",
            "qty" => 2
        ),
        array(
            "sku" => "testSKU",
            "quantity" => 4
        )
    );

    $resultCartProductAdd = $proxy->call(
        $sessionId,
        "cart_product.add",
        array(
            $quoteId,
            $arrProducts
        )
    );


texts: Some product images missing on category page?

texts:
Some of my product images are missing on my category pages. The product has all the images set and they show in the backend and also on the product page itself. Just the category image is missing and the placeholder image is shown.

I tried reindexing, disabling and clearing all caches, nothing helped so far. The images are about 300kb to 400kb in size and the problem also occurs with the default list.phtml. Any ideas what else might be wrong?

Magento 1.7.0.2

Thanks


texts: Problem while compile less in custom theme of magento 2

texts:
In folder app\design\frontend\Vendor\theme\web\css\_styles.less
It already @import 'source/lib/_lib.less' this will define variables/_colors.less
But i can't figure out why magento raise undefine variables in module Magento_Theme inside of my custom theme
Is it process compile less in module first then go to web folder of theme?

Testing with Magento 2.0.2 and xampp on windows 10


texts:
I think this is an incredibly simple question (but I maybe wrong) so I apologise if it is.

We have a module with this code in it

public function getCustomerGroup()
{
    $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
    return Mage::getModel('customer/group')->load($groupId)->getCode();
}

Instead of its current value, I would like it just to return another value (I shall call this value 'value') for everything / everyone, what do I need to replace the

Mage::getSingleton('customer/session')->getCustomerGroupId();
    return Mage::getModel('customer/group')->load($groupId)->getCode();

To get this value to show?


texts: Using "or" logical operator in Magento SOAP V1 API

texts:
I'm using SOAP V1 API in PHP and have set up a number of scripts using this API, all are working as expected.  However, I've been asked to look at finding orders based on certain criteria and I'm not sure if there's a way I can do this.

I've got the following set up:

$filters = array(
             "complex_filter" => array(
                    array(
                        "key" => "customer_email",
                        "value" => array(
                            "key" => "like",
                            "value" => "%gmail%"
                        )
                    )
                )
                );
    $result = $client->salesOrderList($session, $filters);

This is looking at the salesOrderList call and asking for it to bring back any order where the email address contains the word "gmail".  The results are as expected but I'd like to add the ability to be able to filter even more.

Is there a way I can go on to filter on the first name containing "Robert" OR the surname containing "Robert"?

I know if I use the following, it would look up any order where the first name contains "Robert" AND the surname contains "Robert", which brings back no results (because there's no orders with the first and last name being "Robert"):

$filters = array(
             "complex_filter" => array(
                    array(
                        "key" => "customer_email",
                        "value" => array(
                            "key" => "like",
                            "value" => "%gmail%"
                        )
                    ),
                    array(
                        "key" => "customer_firstname",
                        "value" => array(
                            "key" => "like",
                            "value" => "Robert%"
                        )
                    ),
                    array(
                        "key" => "customer_lastname",
                        "value" => array(
                            "key" => "like",
                            "value" => "Robert%"
                        )
                    )
                )
                );
    $result = $client->salesOrderList($session, $filters);

How can I add the "or" logical operator using this API?


texts: PHP Extension bcmath is missing in PHP Extensions Check

texts:
I found a lot of questions on this topic. but sorry, nothing can resolve my issue.

I am using virtual box to run centos 7.
I have downloaded Magento 2.3.
I tried composer install on my Magento folder and it returns the error,

moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system

so I searched for this error, and I got an answer to install bcmath with the command

sudo yum install php7.2-bcmath

at this time, I faced another issue, like

and again searched for this and got another answer to try out with

sudo yum install php7.2-bcmath --disablerepo=epel\*

I ran this command, and the result shows like below,

and the thing is that I am just trying to configure Magento. I spent 3 days on it. really fed up. I got stuck.

Please help me to go forward.
still, I am facing the issue with

moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system

my php -v is

PHP 7.2.9 (cli) (built: Aug 25 2018 14:12:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
with Zend OPcache v7.2.9, Copyright (c) 1999-2018, by Zend Technologies


texts: I've set up the cron job for magento. Do I have to set up a separate cron job for reindex? I'm running Magento 1.9.1


texts:
I am developing a new module for my company in **Magento 2** and i require an AJAX Http post request, however I cannot find the correct URL.

I have all of my controllers currently set up however, when I send the request in JQuery I receive a 404 error.

File structure:

->Controller

---->Post

--------->Message.php

--------->User.php

---->Get

--------->Threads.php

--------->Messages.php

For example, if i am trying to send a request to Post/Message.php, What would the correct URL be?

Thanks.


texts: Magento 2 Product Image are not showing on cart page and checkout page

texts:
Product Image are displaying fine on the category page or list page and product description page but it's not showing on cart page and checkout page.
I have tried following command:-

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento catalog:images:resize
php bin/magento indexer:reindex

Here all the product image are displaying properly on the list page but...its not showing on cart page. Please help me.


texts: Products not showing up in frontend or backend but are enabled and stored correctly in flat table

texts:
Magento 1.5.1.0

We have a store with about 70,000 active products. Some of the products are showing up in the frontend, but not in the backend. When trying to access one of those products in the backend using its id (see "hack" below), I was told the product no longer existed.

Products may have been deleted using the admin import option for deleting. But I don't think so.

I came upon the problem while trying to update a bunch of products. I received the following error:

Product Type is invalid or not supported in rows:

with a list of about 500 rows.

The whole csv was formatted the same way. I cannot find any problems with the sku field, but it appears that the system is not recognizing them as existing products.

I tried searching for one of those products in the backend and got no results, whether using sku, name, or id range. I tried this backend "hack" where you click on a product, then replace the id in the url with the id of the product you want to see. But submitting that url resulted in this error:

This product no longer exists.

But the product is searchable on the front end and appears in the catalog and product page.

I traced the This product no longer exists. error to this file, where $product->getId() is returning false.:

app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php

Here's the first part of the function where the error is generated:

public function editAction()
    {
        $productId  = (int) $this->getRequest()->getParam('id');
        $product = $this->_initProduct();

        if ($productId && !$product->getId()) {
            $this->_getSession()->addError(Mage::helper('catalog')->__('This product no longer exists.'));
            $this->_redirect('*/*/');
            return;
        }

The Product Type is invalid or not supported in rows error is generated in this file:

/app/code/core/Mage/ImportExport/Import/Entity/Product.php

in public function validateRow around line 1433, with this code:

if (!isset($rowData[self::COL_TYPE])
                    || !isset($this->_productTypeModels[$rowData[self::COL_TYPE]])
                ) {
                    $this->addRowError(self::ERROR_INVALID_TYPE, $rowNum);

which is itself contained inside the else statement of this if block:

if (isset($this->_oldSku[$sku])) {

And what that apparently means is that the code did not locate the sku in that array (where skus are keys).

But the product appears in the product flat table, even after reindex.
A query for the all ghost items' status shows they are all enabled:

SELECT value, COUNT(*) FROM catalog_product_entity_int WHEREattribute_id = 84 AND entity_id IN (75962, ... etc)
) GROUP BY value

Any ideas?


texts: Third party extensions does not have adminhtml.xml to fix Access Denied errors after installing SUPEE-6285

texts:
As posted here, the ACL resource must be find in adminhtml.xml, but in extension I have there is no such. However, the acl is defined in community/3rdparty/extension/etc/config.xml file. In addition, there are

community/3rdparty/extension/controllers/Catalog/product/itsfile.php
community/3rdparty/extension/controllers/Customer/itsfile.php

How would be the RESOURCE IDENTIFIER in such cases?

In which controller protected function _isAllowed() must be added?


texts: Magento 2.1.10: How to override Magento\Framework\Session\SessionManager

texts:
I'm looking for solution for override.

  Magento\Framework\Session\SessionManager

I use the usually way (preference in di.xml), but no hope.

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Framework\Session\SessionManager" type="Gssi\FixEmptyCart\Session\SessionManager" />
</config>

  SessionManager.php

<?php
/**
 * Magento session manager
 *
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Gssi\FixEmptyCart\Session;

/**
 * Session Manager
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class SessionManager extends \Magento\Framework\Session\SessionManager
{
    public function regenerateId()
    {
        var_dump('1234'); exit;
        if (headers_sent()) {
            return $this;
        }

        if ($this->isSessionExists()) {
            $oldSessionId = session_id();
            session_regenerate_id();   //regen the session
            $new_session_id = session_id();

            $_SESSION['new_session_id'] = $new_session_id;

            // Set destroy timestamp
            $_SESSION['destroyed'] = time();

            // Write and close current session;
            session_commit();
            $oldSession = $_SESSION;   //called after destroy - see destroy!
            // Start session with new session ID
            session_id($new_session_id);
            ini_set('session.use_strict_mode', 0);
            session_start();
            ini_set('session.use_strict_mode', 1);
            $_SESSION = $oldSession;
            // New session does not need them
            unset($_SESSION['destroyed']);
            unset($_SESSION['new_session_id']);
        } else {
            session_start();
        }
        $this->storage->init(isset($_SESSION) ? $_SESSION : []);

        if ($this->sessionConfig->getUseCookies()) {
            $this->clearSubDomainSessionCookie();
        }
        return $this;
    }

    public function start()
    {
        if (!$this->isSessionExists()) {
            \Magento\Framework\Profiler::start('session_start');

            try {
                $this->appState->getAreaCode();
            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                throw new \Magento\Framework\Exception\SessionException(
                    new \Magento\Framework\Phrase(
                        'Area code not set: Area code must be set before starting a session.'
                    ),
                    $e
                );
            }

            // Need to apply the config options so they can be ready by session_start
            $this->initIniOptions();
            $this->registerSaveHandler();
            if (isset($_SESSION['new_session_id'])) {
             // Not fully expired yet. Could be lost cookie by unstable network.
             session_commit();
             session_id($_SESSION['new_session_id']);
             }
            // potential custom logic for session id (ex. switching between hosts)
            $this->setSessionId($this->sidResolver->getSid($this));
            session_start();
            if (isset($_SESSION['destroyed'])) {
               if ($_SESSION['destroyed'] < time()-300) {
                   $this->destroy(['clear_storage' => true]);

               }
            }
            $this->validator->validate($this);

            register_shutdown_function([$this, 'writeClose']);

            $this->_addHost();
            \Magento\Framework\Profiler::stop('session_start');
        }
        $this->storage->init(isset($_SESSION) ? $_SESSION : []);
        return $this;
    }
}
?>

I've also clear cache, enable this module, setup upgrade ..
Please help, thanks :)


texts: Shopping Cart Rule and Catalog Price Rule -- Stop further Rule Processing not working

texts:
I have a number of Shopping Cart Rules with several different Actions but also I have one Catalog Price Rule giving 40% off everything.

Now while this 40% Sale is on I don´t want any other Rules to be processed.

But somehow this won´t work. Is this because some are Shopping Cart Rules and one is the Catalog Price Rule?

I set "Stop Further Rules processing" to Yes on both.


texts: magento 2 how to dispaly total products weight in shipping method chekcout page

texts:
I want to display total products weight

(products weight* items quantity) in chekcout page shipping method lable beside.


texts: Difference dot(.) and underscore(_) between block name

texts:
As i go through editing/creating theme, i find that at some places magento block names are with underscore(_) or dot(.), e.g

<block name="paypal.partner.right.logo"template="paypal/partner/logo.phtml"/>

and somewhere it is

<block type="catalog/product_price_template" name="catalog_product_price_template" />

It get confusing, why magento has . syntax and somewhere _.

How does one remove a block name which has following syntax

<block type="catalog/product_price_template" name="catalog_product_price_template" />


texts: Shipping charge not transferring to PayPal Express from Shopping cart - magento 2

texts:
I have a site that I am building and whenever I press the "checkout with paypal express" button(Shopping cart page) the shipping rates aren't being processed on Paypal for guest customer.

In Cart page, Shipping are calculated in summary block but when payment are paid through paypal express button, Paypal popup only show subtotal.

I get to the Paypal Login screen on popup when click on button, where it shows  the "Login" form and subtotal calculated.

Looking at the summary, the overall total doesn't add shipping - does anyone know how to fix this problem? Any help for issue.

When i am logged in, Paypal is calculated shipping charge properly when I click from shopping cart page.

Thanks.


texts: products not showing in category on frontend Magento 2, but they are showing record count on category navigation

texts:
our items are no longer showing for each category page on the frontend.

I have checked lots of items on the admin:

Enabled = yes
Product in website = yes
Product in category = yes
Stock status in stock = yes
Visibility = catalog, search
Reset index, Reindex and flush cache = yes

Website = https://www.theemporiumdirect.co.uk/

(item blocks such as New items, related items, upsell items are showing).

Any advise would be much appreciated!

Rik


texts: Override magento2/pub/errors/default/503.phtml using custom module

texts:
How to Override below phtml file in magento 2 using custom module?

magento2/pub/errors/default/503.phtml


texts: Magento 2 - Batch Update SKU in database to remove /

texts:
We have a problem that we can't use the Magento API to load products where the SKU has a / in it. To get around it I am looking at bulk updating all our SKU's to replace the / with a _
These are all the tables I can find that have an sku column, does anyone know if it would cause any issues if I ran the following?
Update `catalog_product_entity` SET sku = Replace(sku,"/","_");
Update `catalog_product_option` SET sku = Replace(sku,"/","_");
Update `catalog_product_option_type_value` SET sku = Replace(sku,"/","_");
Update `inventory_low_stock_notification_configuration` SET sku = Replace(sku,"/","_");
Update `inventory_reservation` SET sku = Replace(sku,"/","_");
Update `inventory_source_item` SET sku = Replace(sku,"/","_");
Update `quote_address_item` SET sku = Replace(sku,"/","_");
Update `quote_item` SET sku = Replace(sku,"/","_");
Update `sales_creditmemo_item` SET sku = Replace(sku,"/","_");
Update `sales_invoice_item` SET sku = Replace(sku,"/","_");
Update `sales_order_item` SET sku = Replace(sku,"/","_");
Update `sales_shipment_item` SET sku = Replace(sku,"/","_");

Or is there a better way to bulk update all the SKU's?
Cheers,
Tim


texts:
I want to import images into magento2.1 with default importer.
My problem is that I added image folder into pub like this:

pub/media/catelectronicpic/mobile/1.jpg
pub/media/catelectronicpic/laptop/1.jpg

but after import, all the images in front-end are same, it shows 1.jpg for all products


texts: magento 2 - How to use composer for extension

texts:
Im developing an extension and would want to use some composer extensions in it. So I have a composer.json file in app/code/Vendor/Extension/ path.

Do I simply run composer update in the extension directory? This will put the vendor directory into the extension right? Is there a way I can have magento pick up the composer.json of my extension when I run a update from root?

Also most importantly what is the best practice in this?


texts:
I setup the admin to access resources through REST API.
Here is my current setup:

Then I assigned a Role user for the admin:

When I login as an admin and try to access the REST API, I still get unauthorized as seen here:

Any ideas of what I am missing?


texts: Magento reindex gives Integrity constraint violation: 1062 Duplicate entry on product category index

texts:
We did the migration from 1.9.0.1 to 2.0.7 and when I reindex through the command line with php bin/magento indexer:reindex I get the following error after Product Categories Index:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-0-1' for key 'PRIMARY', query was: INSERT INTO `catalog_product_index_tier_price` SELECT `tp`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, MIN(IF(tp.website_id = 0, ROUND(tp.value * cwd.rate, 4), tp.value)) FROM `catalog_product_entity_tier_price` AS `tp`

INNER JOIN `customer_group` AS `cg` ON tp.all_groups = 1 OR (tp.all_groups = 0 AND tp.customer_group_id = cg.customer_group_id)

INNER JOIN `store_website` AS `cw` ON tp.website_id = 0 OR tp.website_id = cw.website_id

INNER JOIN `catalog_product_index_website` AS `cwd` ON cw.website_id = cwd.website_id WHERE (cw.website_id != 0) GROUP BY `tp`.`entity_id`,

`cg`.`customer_group_id`,
`cw`.`website_id` ON DUPLICATE KEY UPDATE `min_price` = VALUES(`min_price`)

What is going wrong or how to solve?


texts: Exclude tax price for wholesale customer

texts:
I am running B2B and B2C website. My problem is that I want to show price with exclude tax for only wholesale customer and price with including tax to retail customer.

How can I achieve? Any help appreciated


texts: Show sizes on productlist for configurable products

texts:
I have a bunch of configurable products where I want to show the sizes available under the product price on the product list.

Every configurable product has simple products attached each with a size attribute like XL, L, M, S.

How do I do that in my template file: Magento_Catalog/templates/product/list.phtml ?


texts: Can you set a template for every action within a controller?

texts:
For instance I have a module My/Module (my_module) with a controller RenderController.php which has an action layoutAction. Is there a way that I can set a template for every action within the RenderController controller without having to do it for each individual "page" using layout xml.

I essentially want something like this:

<default>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
</default>

but I don't want that template to be assigned for EVERY page in my theme, but only for those within my module, or even the specific controller (RenderController.php) within that module.


texts:
We have designed My account page using HTML. Now we have to implement the same design on our website.

In order to get the same design, where I have to modify the CSS?

Could anyone please help me with this?


texts: Magento 2 disable Bank Transfer on website level

texts:
I created two sites , website 1 and Website 2. Each website has its own store and store view.

For bank transfer, it is only available on Website A and not website B. So I clicked STORES >>  Configuration >> Payment Method to do the following setting:

Default Config:

Bank Transfer : Enabled

Website 1

Bank Transfer : Enabled

Website 2

Bank Transfer : Disabled

When I checkout using website 2 , I still see the bank transfer option, despite it being disabled. I even cleared the cache and why such behavior is happening and can someone please advice me? Is this a bug in Magento 2.1.3?


texts: Magento Product Attribute "Manage Label / Options" content not showing

texts:
I have been given a task of upgrading an old store's Magento ver. 1.7.0.2 to Magento ver. 1.9.2.0.

Had quite a few issues which seems to be normal when it comes to Magento upgrades, but got all sorted after some nights work. However there seems to be a minor issue on the backend where if you navigate to the following...

> Admin > Catalog > Attributes > Manage Attributes > [Any Custom Attribute] > Edit Product Attribute

The "Manage Label / Options" tab displays nothing if you click it. You can see what I mean in the screenshot provided.

I still have the old system backed up (Magento ver. 1.7.0.2) and it displays the following on the same page

I have tried searching for someone with a similar issue, without any results. Have also tried looking into the phtml files, but could not find any errors there. Nor are there any errors with ini_set('display_errors', 1); on. Tried deleting cache and reindexing without luck.

Hope someone can help me with this issue, and thanks in advance! If there is any additional information required, I'll be happy to provide it.

Although I believe it is an irrelevant issue, my var/log gives me the following

2015-09-03T03:30:37+00:00 ERR (3): Notice: Undefined variable: productId  in **/app/design/frontend/default/helloresponsive/template/catalog/product/compare/sidebar.phtml on line 32


texts: How to connect two Magento2 instance by API?

texts: I want to create one one product from backend then it should be automatically created into second M2


texts:
I am setting up a multi vendor ecommerce site, I have a couple of requirements for it that I am looking for potential extensions.
I am looking to have ppc on the site advertising products within the category, and possibly exchange recommendations, when a customer is looking at a product. Does anyone have an extension for this?
I am looking a ‘FBA’ equivalent setup where I would stock products on our own premises for next day delivery, and these would be shown in a separate part of the site, where the vendor could load products with us and see onsite stock.
Could anyone advise on or against the multivendor extensions?
Thanks in advance
Thomas


texts: How to call bxslider.js in a custom module?

texts: I have a custom module, I need to call a library of sliders there, can anyone help me?


texts: Magento 2 : What is difference between Extension Attributes and Custom Attributes?

texts:
I have question in my mind what is exact difference between Extension Attributes and Custom Attributes ?

Any one here who can provide me some ideas ?!


texts: How to use .abs- (from abstract) from UI library LESS?

texts:
Magento Documentation for UI Library has said to use "Extend class names should have prefix .abs- (from abstract)"

There is no other explanation for the usage in the documentation

How should we use it in LESS?


texts: Magento 2 Default Catalog Search Page Was Not Working .. it's Blank Page Present

texts:
I have set new theme and all page are working fine but the catalog search page are blank....

Here i Ad my

  /public_html/app/design/frontend/{Vendor}/{Project}/Magento_CatalogSearch/layout
  Default.XMl

    <?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="top.search">
            <block class="Magento\Framework\View\Element\Template" name="advanced-search-link" template="Magento_CatalogSearch::advanced/link.phtml" />
        </referenceBlock>
        <referenceBlock name="footer_links">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="catalog-search-advanced-link">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Advanced Search</argument>
                    <argument name="path" xsi:type="string">catalogsearch/advanced</argument>
                    <argument name="attributes" xsi:type="array">
                        <item name="data-action" xsi:type="string">advanced-search</item>
                    </argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

Front End Image

  http://prntscr.com/sb9kok


texts: Prevent child block from cache (cacheable false) but not parent block (cacheable true) in magento 2.2.2

texts:
I am working on a custom module template where I need to show some random string only in some part of a page and string should be generate randomly on every time page reload also the rest of the content should be cached content. For this, I have tried following code in layout xml :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="c.parent.block" template="Company_Module::parent.phtml" >
                <block class="Company\Module\Block\Myblock" name="m.child.block" template="Company_Module::child.phtml" />
            </block>
        </referenceContainer>
    </body>
</page>

parent.phtml file content :

..............
..............
/* Content should be cached */
..............
<?=$this->getChildhtml('m.child.block'); /* Prevent cache content*/ ?>
..............
..............

child.phtml file content :

<?php echo 'Random String : '. rand(); ?>

Above code working fine with my cache enabled store. But I want the above child block should not be cached for this I have passed cacheable="false" attribute with child block. Although this prevent the cache but its also prevent the cache for parent block. Is it possible to prevent the above child block from cache but not its parent block?

Note : I don't want to use any ajax request to generate random string.


texts: Make taxvat not required on customer registration form programmatically

texts:
I want to force taxvat field as not required on customer create form
Even if i have ovrride

  vendor/magento/module-customer/view/frontend/templates/widget/taxvat.phtml

with a plugin in my custom module

<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('taxvat')) ?>"><?= $block->escapeHtml($block->getStoreLabel('taxvat')) ?>

    <input type="text" id="<?= $block->escapeHtmlAttr($block->getFieldId('taxvat')) ?>" name="<?= $block->escapeHtmlAttr($block->getFieldName('taxvat')) ?>" value="<?= $block->escapeHtmlAttr($block->getTaxvat()) ?>" title="<?= $block->escapeHtmlAttr($block->getStoreLabel('taxvat')) ?>" class="input-text ">

removing data-validate="{required:true}"

when i submit form it get me error "Tax/VAT Number" is a required value.


texts: How to get order Grand Total from information about order's items (products)?

texts:
I'm building a custom report on the basis of database.

I need to know how to get 'Grand Total' that is in 'sales/order' (in other words sales_flat_order) table by order items (from 'sales/order_item', sales_flat_order_item table).

I need a formula to get this value using the database and not using Magento methods.

I am building MySQL query

Am I right when I say that

base_grand_total =  (IFNULL(base_total_canceled,0)) +  (IFNULL(base_hidden_tax_amount,0) - IFNULL(base_hidden_tax_refunded,0)) + IFNULL(base_total_offline_refunded,0) + IFNULL(base_total_online_refunded,0) +  ( IFNULL(base_subtotal,0) - IFNULL(base_subtotal_canceled,0) - IFNULL(base_subtotal_refunded,0)) + (IFNULL(base_tax_amount,0) - IFNULL(base_tax_canceled,0) - IFNULL(base_tax_refunded,0)) + (IFNULL(base_shipping_amount,0) - IFNULL(base_shipping_canceled,0) - IFNULL(base_shipping_refunded,0)) + (IFNULL(base_discount_amount,0) - IFNULL(base_discount_canceled,0) - IFNULL(base_discount_refunded,0)) ?


texts: Buy 3 items and get the cheapest one free: Magento 2

texts: I'm searching for at solution for being able to sell a customer 3 different product items and then getting the cheapest one for free.   Can I accomplish this through the magento admin or does it require custom coding/extension?   I'm on Magento ver. 2.1.7.


texts:
I am using this data-migration-tool,
When i migrate from magento 1.9.3.2 to magento 2.3,getting below error,

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'SALES_ORDER_INCREMENT_ID_STORE_ID'

i tried many times upload fresh DB,still getting this issue


texts: GraphQl does not return CMS page having CMS block

texts:
I have created CMS Page which have custom CMS block.
{{block class="Magento\Framework\View\Element\Template" template="Vendor_Test::cms/vendortest.phtml"}}

This CMS Page gets reflected correctly at the magento frontend with all the content alongwith cms block. But GraphQl returns error.
Error filtering template: Invalid template file: 'Vendor_Test::cms/vendortest.phtml' in module: '' block's name: 'magento\\framework\\view\\element\\template_0

Is this core bug ? Or am I missing something ? I can't find anything related to this in magento forum.


texts: Magento 2.3.2 product save very slow with Varnish cache enabled

texts:
I have a very fast Magento 2 backend, I have configured Varnish caching. When I save any product, it takes about 20 seconds to save while loading the product edit page goes very fast. Saving category pages are also slow while saving customer data it's very fast. So it must be something with the cache invalidation I think.

The moment I switch back to inbuild cache, it's very fast again. No changes in IP's etc. I checked the cache purge IP's but it looks like there is no issue.

I have upgraded from Magento 2.1.9 to 2.3.2. Probably there's an issue. I have a fresh Magento 2 installation, on the same server that doesn't have that problem.

Also, my Varnish server is a seperate server. I host them both in Azure. They are both in different subscriptions, networks are peered. At first I thought that the problem could be a network issue but than the second Magento 2 installation should have the same problems. Both server can reach each other on port 80 and 443.

I checked varnishncsa and varnishlog, I can't find any errors.

Any idea's?


texts: How can i get viewed product also viewed other product list and also bought product list?

texts: I am using magento ver 1.9.2.3 , how can i get viewed product also viewed product list and also bought product based on my customer list using available options?


texts:
Customer email is required in one step checkout Magento 1.9.3.8
but last some time I have had a few orders that have not captured the customers email or at least not saved it to the Magento order.

Usually it happen when customer try to select as Guest and place order.
As i checked in database it missing the info in sales_flat_order.

It's not happening any particular payment method. this missing email happening randomly

please help to sort out this issue .

Thanks in advance


texts: Which event fire on address change in Magento 1 Admin?

texts:
After place new order by customer, If Admin change shipping address of customer from Sales-> Orders then I want to know which event fire while changing address, so that I can call my function in observer.

Please help.


texts: How to use Create Extension Package in Magento 1.9

texts:
I created a module now i want to make it live, for this, i am using Create Extension Package and trying to install from connect manager before submitting for approval

Issues that i am facing:

1) in var/connect i have

hb-pc-15@hb-pc-15:/var/www/html/magento-mirror/var/connect$ ls -la
total 1464
drwxrwxrwx 2 www-data www-data    4096 Mar 16 17:10 .
drwxrwxrwx 8 www-data www-data    4096 Mar 16 17:08 ..
-rwxrwxrwx 1 www-data www-data    6355 Mar 16 17:10 modulename.xml
-rw-rw-rw- 1 www-data www-data 1477013 Mar 16 17:10 Companyname_Modulename-1.0.0.tgz
-rwxrwxrwx 1 www-data www-data    2950 Mar 16 17:10 Companyname_Modulename.xml

2) In Companyname_Modulename-1.0.0.tgz i have

app
    ----> code
     ----->etc
skin
package.xml

design folder is missing

Update: i got the correct Targets and Path

Update: I am getting an error,

CONNECT ERROR: Unsupported resource type


texts: Magento Import error: image could not be downloaded from external resource

texts: How can I solve this import error? I don't know what the error means. I tried many times but I don't know what's the error...


texts: magento 2 Deepest Category product list page gives Error 500. Which files to inspect?

texts:
The site I'm working on the lowest category page (suppose to be list view) give the error 500.
I'm not quite remember file I edited.
search result also return the same error.
Which files should I look into to fix the error?

Thanks.

  this is the error from debug.log  [2019-02-22 06:36:35] main.DEBUG: cache_invalidate:  {"method":"GET","url":"https://dev.siig.com/it-products/video-display/display-adapters/usb-2-0.html","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []
  [2019-02-22 06:37:41] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []


texts:
i want to add custom parameter to product say quality:A,B,C
with different additional prices like A(10), B(15), C(5)

Now when user selects A product will be added to cart with price + 10
i also want to show A in admin order detail.

How can i do this via module / observer.

Pls help , its new for me

below code does not works

<?xml version="1.0"?>
<config>
  <modules>
    <Mour_Customgroup>
      <version>0.1.0</version>
    </Mour_Customgroup>
  </modules>
  <frontend>
    <events>
        <checkout_cart_product_add_after>
            <observers>
                <setadiscountprice>
                    <class>Mour_Customgroup_Model_Observe</class>
                    <method>modifyPrice</method>
                </setadiscountprice>
            </observers>
        </checkout_cart_product_add_after>
    </events>
  </frontend>
</config>

<?php
class Mour_Customgroup_Model_Observe
{
    public function modifyPrice(Varien_Event_Observer $observer)
    {
        /* @var $item Mage_Sales_Model_Quote_Item */
        $item = $observer->getQuoteItem();
        if ($item->getParentItem()) {
            $item = $item->getParentItem();
        }

        // This makes sure the discount isn't applied over and over when refreshing
        $specialPrice = $item->getOriginalPrice() +10;

        // Make sure we don't have a negative
        if ($specialPrice > 0) {
            $item->setCustomPrice($specialPrice);
            $item->setOriginalCustomPrice($specialPrice);
            $item->getProduct()->setIsSuperMode(true);
        }
    }
}


texts: Magento2 reindex all indexes once a week by cron

texts:
In backend all indexes are set Update by Schedule. But it works every minute.
How can I set reindex all once a week?


texts:
I want to rename "Fax" to "Mobile" on the backend (Create New Order page). I assumed this could be achieved by updating my en_GB.csv file in my child theme.

  Assembling the preceding pt_BR.csv files across all modules and the current theme results in a Portuguese translation of the entire application area (storefront or the Admin). - Magento Docs

However, this does not appear to have any affect. Is this label actually translatable? I prefer not override a file for something so trivial.

Note: My translation file works fine for everything else and cache is currently disabled. So I know it's nothing like that.


texts: How to add product attribute value in custom collection?

texts:
I have a custom table which contains product id, I want to add an extra attribute column. so how can I get dropdown attribute value of the product in my custom table? if the dropdown attribute is not selected the data will be display as blank.

namespace Demo\Test\Model\ResourceModel\Grid;

class Collection extends SearchResult
{
     /**
     * Initialize dependencies.
     *
     * @param EntityFactory $entityFactory
     * @param Logger $logger
     * @param FetchStrategy $fetchStrategy
     * @param EventManager $eventManager
     * @param string $mainTable
     * @param string $resourceModel
     */
    public function __construct(
        EntityFactory $entityFactory,
        Logger $logger,
        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        $mainTable = 'custom_table',
        $resourceModel = \Demo\Test\Model\ResourceModel\Load::class
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
    }
    protected function _initSelect()
    {
        $this->getSelect()->from(['main_table' => $this->getMainTable()]);
        return $this;
    }
}


texts: I want to migrate Magento 1.7.x to magento 2.x

texts:
Can anyone suggest a proper process to achieve migration of magento 1.7 to 2.x?
There is reference but all scattered, since many things are needed to considered and major concern includes data migration.


texts: Huge slow query for products, categories, filters

texts:
I run a Magento 1.9 based store with around 40 thousand active products. Using an FPC I am able to keep the server stable sometimes, and other unstable. While checking for highest hardware consumption I found the following query with thousands of numbers related to product IDs inside the query where I wrote ...

Have you been through this problem and came to a solution ? Do you have any ideas on how to solve it ?

Best regards,
Gustavo Ulyssea

** UPDATE **
These are internal queries related to filters. I found it impossible to have Magento 1 working with this number of products, event using CDN, FPC, etc. After some months working on a migration process now the site runs great on a Magento 2 installation.

SELECT `e`.*, `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`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e`

 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

 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(3, 4) AND cat_index.category_id = '2'
 WHERE (`e`.`entity_id` IN(36873, 43340, 43334, 43318, ...))

 ORDER BY FIELD(`e`.`entity_id`, 36873, 43340, 43334, ...)) ASC LIMIT 7


texts: Magento 2.3.5 Installation Issue, Can any one help?

texts:
I am trying to install Magento 2.3.5 and facing issue in my local environment.

Thanks in Advance.


texts: Fontawesome kit not loading Magento 2.3.6

texts:
I am trying to use the new fontawesome kit url in magento 2.3.6 but i cant get it to work. It seems to load the js but not icons aren't displayed.
I have added <script src="https://kit.fontawesome.com/<my-unique-id>.js" crossorigin="anonymous" src_type="url"></script> to my default_head_blocks.xml and when using developer tools in my browser i can see it is fetching the URL, but no icons load, but the styling is present if you inspect the element.  is one particular element i am using.
Does anyone have any ideas apart from adding font awesome locally which i was trying to avoid.


texts: .htaccess file in magento contains what?

texts:
I have my .htaccess contains the following:

Mac OS X 2¢ÔATTRÔ˜<˜<com.apple.quarantineq/0002;5596b949;Safari;F9417E7F-EAFC-41E0-BA60-E4E5FB339DEA

I don't know if this file is should be like that or is currently something wrong with it? Please advice thanks.


texts: Magento semi ignores System > Config > Catalog > SEO setting

texts:
So I have set Magento not to include category URLs into the product URL and it works fine when browsing site but if I visit the "old" URL, it does not redirect to the categoryless page.

Is this normal? 1.9.2.1

Example:

https://www.airytea.com/organic-imperial-white-peony-white-tea.html

https://www.airytea.com/buy-organic-white-tea/organic-imperial-white-peony-white-tea.html

Moz.com indexed both and I have no idea how and I can't find a way to replicate where did it grab the second URL from but my biggest issue that is still works and it should not!


texts: Magento keeps sending emails from a giftcard module

texts:
We bought and installed a gift card module from Magestore and when I was testing it on our staging website I noticed that it kept sending emails every two hours for the gift card.

How can I stop these emails?  I have read that if I run this mysql command truncate table cron_schedule; it will stop the emails from being sent, but won't that stop every email from being sent?

Also, any tips on how I can go about debugging this issue?  I checked the modules code and they have some cron jobs configured...

<crontab>
    <jobs>
        <giftvoucher>
            <schedule>
                <cron_expr>0 0 * * *</cron_expr>
            </schedule>
            <run>
                <model>giftvoucher/observer::autoSendMail</model>
            </run>
        </giftvoucher>
        <giftvoucherschedule>
            <schedule>
                <cron_expr>15 */2 * * *</cron_expr>
            </schedule>
            <run>
                <model>giftvoucher/observer::sendScheduleEmail</model>
            </run>
        </giftvoucherschedule>
        <giftvoucherautodeleteimage>
            <schedule>
                <cron_expr>30 0 * * *</cron_expr>
            </schedule>
            <run>
                <model>giftvoucher/observer::autoDeleteImage</model>
            </run>
        </giftvoucherautodeleteimage>
        <giftvoucherautodeleteimage1>
            <schedule>
                <cron_expr>45 0 1 * *</cron_expr>
            </schedule>
            <run>
                <model>giftvoucher/observer::autoDeleteImage1</model>
            </run>
        </giftvoucherautodeleteimage1>
    </jobs>
</crontab>

And when I check the Magestore_Giftvoucher_Model_Observer class I see the below functions:

/**
 * Send scheduled email
 */
public function autoSendMail()
{
    if (Mage::helper('giftvoucher')->getEmailConfig('autosend')) {
        $giftVouchers = Mage::getModel('giftvoucher/giftvoucher')->getCollection()
            ->addFieldToFilter('status', array('neq' => Magestore_Giftvoucher_Model_Status::STATUS_DELETED))
            ->addExpireAfterDaysFilter(Mage::helper('giftvoucher')->getEmailConfig('daybefore'));
        foreach ($giftVouchers as $giftVoucher) {
            $giftVoucher->sendEmail();
        }
    }
}

/**
 * Send scheduled email for friend
 */
public function sendScheduleEmail()
{
    $collection = Mage::getResourceModel('giftvoucher/giftvoucher_collection');
    $timeSite = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
    $collection->addFieldToFilter('is_sent', array('neq' => 1))
        ->addFieldToFilter('day_store', array('notnull' => true))
        ->addFieldToFilter('day_store', array('to' => $timeSite));
    if (count($collection)) {
        $translate = Mage::getSingleton('core/translate');
        $translate->setTranslateInline(false);
        foreach ($collection as $giftCard) {
            $giftCard->save();
            if ($giftCard->sendEmailToRecipient()) {
                if ($giftCard->getNotifySuccess()) {
                    $giftCard->sendEmailSuccess();
                }
            }
        }
        $translate->setTranslateInline(true);
    }
}

And in the giftvoucher table their is a field called is_sent, which has a value of 2 for the email address it keeps sending it to.

Do I just need to change the value on is_sent in the database?


texts: Get all products in the catalog from my Module controller in 2.1.5

texts:
I'm in a controller's action in a module I just created. How can I get an array with all the products I got in my catalog?

I did this, but it's not returning the items in the catalog

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$collection = $objectManager->create('Magento\Catalog\Model\Product')->getCollection();

Plus, where can I find this kind of information? I'm starting on Magento these last days and everything is just too dificult to learn and find

For example, where is the documentation for 'Magento\Catalog\Model\Product' ? And for Object Manager?

I'm in Magento 2.1.5


texts: Magento migrate 1.9.3.1 to Magento 2.3.4 (multistore): Exception #0 (LogicException): Unable to load theme by specified key: 'NULL'

texts:
I've get a problem when try get any page.

My process migration is regular.

Only different I not' install template in Magento 2. I like use for testing Luma

After migrate settings and migrate data without errors (only a problem with short url) get a problem with theme.

https://www.tiendafetichista.ovh/ Show site with somre problem but show.
https://www.tiendafetichista.ovh/esenciales/ Click on any menu ad I get error

1 exception(s):
Exception #0 (LogicException): Unable to load theme by specified key: 'NULL'

Exception #0 (LogicException): Unable to load theme by specified key: 'NULL'

I go to

  dashboard > Content > Design Configuration and all store has "-- No Theme --"

  I put theme name "Magento Luma" for store, and after I clean caches.

But not work....


texts:
I've build a module for changing the price while adding the product to the cart. This with the observer checkout_cart_product_add_after

Price is changing right, but I also want to change the weight for right calculation of shipping costs.

My Code:

<checkout_cart_product_add_after>
    <observers>
        <zeo_framecalculator_model_observer>
            <type>singleton</type>
            <class>Zeo_FrameCalculator_Model_Observer</class>
            <method>updatePrice</method>
        </zeo_framecalculator_model_observer>
    </observers>
</checkout_cart_product_add_after>

public function updatePrice(Varien_Event_Observer $observer) {
    $item = $observer->getQuoteItem();
    $item = ( $item->getParentItem() ? $item->getParentItem() : $item );

    $item->setCustomPrice($vavatexOrder['custom-price']);
    $item->setOriginalCustomPrice($vavatexOrder['custom-price']);

    $item->getProduct()->setIsSuperMode(true);
    $item->setWeight(10);
}


texts: Which database tables can be completely rebuilt via Magento's Reindex All command?

texts:
Which tables in Magento could be truncated and completely repopulated using a "reindex all" command?

The reason I ask is that I've been working on a daily automation task that prepares "development-ready" copies of our production database.  These backups are intended to be as convenient as possible for developers; part of which is reducing the download size and the time needed to restore a backup from a dump.


texts:
Is bootstrap modal working in magento 2? I have already added my code but it is not working. here is my code
HTML:

<button type="button" class="green-btn btn-add-cart d-block" id="button-cart" data-toggle="modal" data-target="#myModal">ADD TO CART</button>

Who's Attending?

<button type="button" class="close" data-dismiss="modal">&times;</button>

PROCEED

JS


texts: SSL https:// to https://www. redirect before privacy warning Magento

texts:
I have just installed SSL on a server and am now trying to install it in Magento. I've put the base urls in SSL mode, and also changed the http:// to https:// to always use SSL even on product pages etc.

However, when my site is accessed from https:// Google Chrome throws a big fat warning sign that says privacy warning. I can't for the life of me find a solution around this problem to just redirect users to the https://www. version before the error message is thrown.

I'm very sure that there is a solution for this, as I have seen multiple websites just handle this perfectly fine.


texts: Adding TypeKit code (or any code) into the Head of a Magento 2 site

texts:
All I want to do is to add a custom font from TypeKit into my Magento 2 website.

Previously I just used to find /app/design/frontend/XXX/XXX/page/head.phtml and edit that. Simple.

With Magento 2 it seems to be hugely complicated. I keep finding articles like this. Do I really need to create an entire Module just to add 2 lines of basic HTML to the head of a document?

Surely there must be an easier way?

I found this similar question, but I dont get the answer. Where do I create a layout file in my theme? Or is it suggesting I create a whole seperate Module again?

I also found this question, and it looks insane. Am I right in thinking that they are editing 3 seperate files, jsut to add a JS file into head?

Surely this cant be right? Isn't there a head.phtml file I can just edit?

Can someone break this down for me, assume I am an idiot, and explain how I can easily just add 2 lines of TypeKit code to the Head. Many thanks.


texts:
What is the most reliable way to check if current page is the home page? I need to check that in a block class and in a helper class. Searching on forums, I've found two popular ways to do this:

Method 1

The first method is almost the same that worked also in Magento 1:

/**
 * @var \Magento\Framework\UrlInterface
 */
protected $urlInt;
public function getIsHomePage()
{
    return
        $this->urlInt->getUrl('') == $this->urlInt->getUrl('*/*/*', ['_current'=>true, '_use_rewrite'=>true]);
}

Method 2

The second method is the one I've found on stackexchange, something like:

/**
 * @var \Magento\Framework\App\RequestInterface
 */
protected $request;
public function getIsHomePage()
{
    if ($this->request->getFullActionName() == 'cms_index_index')
    {
        return true;
    }
}

Which method is better? Will they both work correctly in all cases, or should I be careful in some specific cases?
Which method is faster? (I understand the difference will be very small)


texts: Admin values of an attribute from filter.phtml

texts:
I am trying to get the admin values of an attribute from app/design/frontend/{package_name}/default/template/catalog/layer/filter.phtml. From this file I am able to get the attribute code (i.e., the admin label of the attribute) and $_item->getValue() only gives me the escaped current store value. I am able to get the admin value of an attribute for a specific product from app/design/frontend/{package_name}/default/template/catalog/view.phtml though:

$productAdminAttributeValue = $_product->getResource()->getAttribute('attribute_name')->setStoreId(Mage_Core_Model_App::ADMIN_STORE_ID)->getFrontend()->getValue($_product);

Thank you in advance.


texts: Save Additional Order MetaData while processing payment

texts:
How can I store additional Metadata and associate with an order while in my paymentcontroller ?

It's a custom payment gateway, and in redirectAction() , while calculating the hash, i would like to save api_key & hash_key with the order.

Here is the PaymentController

public function buildgatewayrequestAction(){
    $order = Mage::getModel('sales/order')
->loadByIncrementId(Mage::getSingleton('checkout/session')
->getLastRealOrderId());
    $orderId = $order->getRealOrderId();
    $model = Mage::getSingleton('paymentmethod/standard');

            $gatewayhash_arg =  array(
                'TIMESTAMP' => gmdate("YmdHis",  time()),
                'amount' => $order->getTotalDue(),
                'api_key' => $model->getConfigData('paymentmethodapi_key'),
                'order_no' => $orderId,
            );
// Here i would like to save the $gatewayhash_arg['api_key'] with the
//current order so that It is accessible later

It just a metadata, I don't require it to be displayed either in backend or any frontend info block

I'll use it to check order status from the payment gateway if payment is pending after a particular amount of time ( opposite of ipn )


texts:
I have downloaded a theme from themelock.com. After unzipping the theme i have following folders: app
         skin
         js
         media.
I have merged these folders with magento main folder. In the configuration>design tab for DEFAULT CONFIGURATION, I have applied my theme under the Theme Section. Still the theme is not applicable. Do help. Thanks in advance!


texts: How to access different websites in magento

texts:
I have set up Magento as per my screenshot here http://snag.gy/XQqER.jpg with multiple websites.

My question is how do access the trade website on the frontend? I presumed it would be http://www.example.com/trade but that brings up a 404


texts: Magento 1 Override Poll controller is not working

texts:
I am trying to override the poll extension of magento but the override that i am doing is not working. My purpose is when someone complete's the poll to redirect him into a different url, instead of seeing the poll results.

So here you can see my folder structure http://prntscr.com/g5rz6w

Config.xml

<config>
<frontend>
    <routers>
        <poll>
            <args>
                <module>
                  <Poll_MF_module before="Mage_Poll">Poll_MF_module_Poll</Poll_MF_module>
                </module>
            </args>
        </poll>
    </routers>
</frontend>

VoteController.php

    require_once('Mage/Poll/controllers/VoteController.php');

class Poll_MF_Module_VoteController extends Mage_Core_Controller_Front_Action {
        die ('vote is dead');
    }

and inside the app/etc/modules/Poll_MF_Module.xml

<config>
    <modules>
        <Poll_MF_module>
            <active>true</active>
            <codePool>local</codePool>
        </Poll_MF_module>
    </modules>
</config>

What am i doing wrong ?


texts: How to get custom order attribute in API?

texts:
In sales_order_grid table I have this custom field:

This field was added by this extension: https://github.com/boldcommerce/magento2-ordercomments
Is it possible to add it as "custom_attributes" in the orders API response, like this:
    "custom_attributes": [
        {
            "attribute_code": "bold_order_comment",
            "value": "test comment"
        }
    ]

It's actually set as extension_attributes at the moment but I need it as custom_attributes.


texts: Send mail address is username@hostname (maybe empty)

texts:
I have a multiple site / scope configuration on Magento 2.4.2. All Send-from (and Return-Path) addresses like order confirmation etc. that Magento sends are always username@hostname.
Found a issue on https://github.com/magento/magento2/issues/14952 but this helps ot for the Magento 2.4-*. How to show send-from addresses correctly?
Magento 2.4.2


texts: Magento 2 Save custom customer attribute to customer addresses in checkout

texts:
There are many post on Stackexchange and blogs that explain how to add custom field to checkout forms. Some of them also explain how to save them to quote/order address.

I've achieved all these results, but I'm still not able to save my custom customer attribute to customer address in checkout neither guest nor registered customers. And what about if the shipping and billing address are different?

Does anyone know if there is a "definitive" guide on how to save custom customer attributes to customer address, or give me a piece of advice about the way to do it?

Thanks


texts: Not saving data when add multiple select attribute in product grid

texts:
I have created one custom module with add associated products concept. Created successfully. Its working Good too.

But when i add "Multi select attribute" column in product grid with that option values, That entity value not saved.

If i removed that option value, Its saving fine.

I have shown my code below what i did for add multi select attribute column in product grid

under _prepareColumns() method

 $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'brand');        // attribute code here
    foreach ( $attribute->getSource()->getAllOptions(true, true) as $option)
    {
        if($option['value'] != '')
        $valArr[$option['value']] =  $option['label'];
    }

$this->addColumn('brand', array(
        'header'=> Mage::helper('catalog')->__('Brand'),
        'align' => 'left',
        'index' => 'brand',
        'type'  => 'options',
        'options' => $valArr,

       'renderer'  => 'Mage_Adminhtml_Block_Catalog_Product_Renderer_Brands', // Will have to create the renderer.
       'filter_condition_callback' => array($this, '_filterBrandCondition')
    ));

When i hide 'options' => $valArr, , All are working fine.

I can't able understand, why its happening. Please suggest me your ideas. Thanks in advance.


texts: Virtualmin backups - Strange blank "Files" within backup that cannot be read

texts:
I have setup a Virtualmin backup that appears to be working correctly.

However, when the backups are attempted to be extracted there is a large amount of errors. WinRAR error below:

This appears to be due to blank "Files" in most folders of the backup that WinRAR says cannot be extracted. These "Files" do not appear in Filezilla when browsing to the same directory on the server. Please see the images for more information:

Does anyone know what these files may be, and whether this is normal, including receiving many errors when extracting the backup?

Thank you
Matt


texts:
I want to trunacate the table 'core_session' by loaded a php script.

How can I fix this, how should this script look like?


texts:
We have bundled products some with flavor options some without if the bundle product doesn't have flavor options we would like the user to be able to add directly to cart from the category page list.phtml instead of sending them to the product page view.phtml.

I found a solution, I created a new attribute set and added this code around line 197 in list.phtml

<?php if(!$_product->canConfigure() && $_product->isSaleable()): ?>
<button type="button" title="<?php echo $this->quoteEscape($this->__('Add to Cart')) ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><?php echo $this->__('Add to Cart') ?></button>
<?php elseif($_product->getAttributeSetId() == 15): ?>
<?php
$productAddUrl = $this->helper('checkout/cart')->getAddUrl($_product);
if ($_product->getTypeId() == 'bundle'):
$bundleOptions = '?';
$selectionCollection = $_product->getTypeInstance(true)->getSelectionsCollection($_product->getTypeInstance(true)->getOptionsIds($_product), $_product);
foreach($selectionCollection as $option):
$bundleOptions .= '&bundle_option[' . $option->option_id . ']=' . $option->selection_id;
$bundleOptions .= '&bundle_option_qty[' . $option->option_id . ']=' . $option->selection_qty;
endforeach;
$productAddUrl .= $bundleOptions;
endif;
?>


texts: Magento 2: How to show/hide payment method on basis of amount

texts:
I'm using Magento 2 CE Version 2.1.0.

I have 2 payment method Paypal Express Checkout & Bank Transfer.

When the amount is greater than X then Paypal should not be displayed only Bank Transfer.

I have configured that variable on admin side on system.xml for X amount.

By referring to Magento 2 : How do we add zipcode validation on COD payment method? as per @Ashish suggestion.

I have below code now

app\code\Custom\Module\etc\frontend\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<type name="Magento\Paypal\Model\Express">
        <plugin sortOrder="1" name="restrictByCustomer" type="Custom\Module\Plugin\Payment\Method\Paypal\Available"/>
</type>

app\code\Custom\Module\Plugin\Payment\Method\Paypal\Available.php

namespace Custom\Module\Plugin\Payment\Method\Paypal;

use Magento\Customer\Model\Session as CustomerSession;
use Magento\Backend\Model\Auth\Session as BackendSession;
use Magento\Paypal\Model\Express;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Checkout\Model\Cart;

class Available {

    /**
     * @var CustomerSession
     */
    protected $customerSession;

    /**
     * @var BackendSession
     */
    protected $backendSession;

    /**
     * @param CustomerSession $customerSession
     * @param BackendSession $backendSession
     */
    public function __construct(
    CustomerSession $customerSession, BackendSession $backendSession, ScopeConfigInterface $scopeConfig, Cart $cart
    ) {
        $this->customerSession = $customerSession;
        $this->backendSession = $backendSession;
        $this->scopeConfig = $scopeConfig;
        $this->cart = $cart;
    }

    /**
     *
     * @param Paypal Express $subject
     * @param $result
     * @return bool
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function afterIsAvailable(Express $subject, $result) {

        // Do not remove payment method for admin
        if ($this->backendSession->isLoggedIn()) {
            return $result;
        }

        $cartQuote = $this->cart->getQuote()->getData();
        $cartGrandTotal = $cartQuote['base_grand_total'];

        list($grandTotal, $decimals) = explode(".", $cartQuote['base_grand_total']);
        $papalMaxShowLimit = $this->scopeConfig->getValue('mygeneral/settings/paypal_show_amount', ScopeInterface::SCOPE_STORE);

        if ($grandTotal > $papalMaxShowLimit) {
            return false;
        } else {
            return true;
        }
    }
}

I have put all condition. But on return false it's not hiding Paypal Express Checkout Method.

[Update] I'm not able select Paypal Payment Method's Radio Button On Checkout Page. It's not hiding it completely.


texts:
I have Enclosed the issue on the screenshot, how can i fix this type issue, "Ordered Downloadable product titles are same." Title should showing the first downloadable product title on the ordered items.in Magento 1.9.1.0 please help me

I noticed the issue by getLinksTitle();
http://forum.azmagento.com/how-to/downloadable-product-links-title-is-wrong-in-the-customer-order-view-and-in-the-admin-order-view-43820.html


texts: Magento 2 set updated_time through query

texts:
I want to update column "updated_time" through query but it is not working. Where I am wrong?

$where = ['entity_id'  => (int)$customerData,

                 ];

        $connection->update(
        $tableName,
        array("updated_at" => 'UTC_TIMESTAMP()'
              ),
        $where
        );

How can I update this field?


texts: How to create a excel file and need to save in root directory?

texts:
I tried to create to a excel file and need to save that created file some places.

$filename = 'request_quote.xlsx';
        $exportData[0]['product_id'] = 123;
        $exportData[0]['product_name'] = 123;
        $exportData[0]['vendor_name'] = 123;

        $data[0]=array($this->__("Product ID"),$this->__("Product Name"),$this->__("Vendors"));

        $i=1;
        foreach($exportData as $key=>$value){
            $data[$i]=array($value['product_id'],$value['product_name'],$value['vendor_name']);
            $i++;
        }

    $xmlObj = new Varien_Convert_Parser_Xml_Excel();
    $xmlObj->setVar('single_sheet', $filename);
    $xmlObj->setData($data);
    $xmlObj->unparse();
    $content = $xmlObj->getData();

    $this->_prepareDownloadResponse($filename,$content);

When i use above code, its forced me to download the excel file.

now my question is how to save that file in folder or root directory?

Note:
not a csv file.


texts:
I'm listing all the reviews on a particular page of my magento store:

$review_collection = Mage::getModel('review/review')
->getResourceCollection()
->addStoreFilter(Mage::app()->getStore()->getId())
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
->setDateOrder()
->addRateVotes();

foreach($review_collection as $_review) {
    // ...
}

My question is how can I get the product of each review, something like this:

$product = $_review->getProduct();

So I can also list the product title and its URL so customers can click on the review to the particular product page.

Better yet, displaying the product cover photo as well so users can compare the product photo with the custom ones.

How can I do this?


texts: Why the check on installation date in M2?

texts:
So i've build a CI/CD process that worked perfectly on Magento 2.0
After upgrading to 2.1, stuff started to collapse.

I use Magento's CLI commands to create env.php dynamically, depending on the stage where it's deployed onto.
Unfortunately this does not set the install date, and since Magento 2.1 this seems to be required before Magento includes any other code than it's own.
This makes it hard to deploy Magento, because i don't want to install on every deployment. And i don't want any credentials in my VCS either.

Using a template is an option, but i'd rather not if i could deploy fully using the CLI tools that Magento provides.

So my question is, why the check on this date before any custom code is included?
And is there a workaround to fully deploy Magento 2.1 (not to install!), using Magento's CLI commands?


texts: How to save only specific attribute value rather than saving the whole product in Magento2

texts:
As you guys already know that we used to have this below method in magento to save a specific attribute value like this.

// saving product attribute
$product = Mage::getModel('catalog/product')->load('id here');
$product->setName('your name here');
$product->getResource()->saveAttribute($product, 'name');

or

// saving customer attribute
$customer->setData($attrCode, $value)->getResource()->saveAttribute($customer, $attrCode);

Can anyone let me know the alternative of the above in Magento2 .


texts: Does Magento send the order increment_id to paypal?

texts:
I'm interrested in matching orders paid with PayPal by their increment id.

Therefore I want to use a summary (from PayPal) of orders and compare it with a list of the increment ids provided by the magento backend.

Currently I'm doing this by opening the transactions panel in the backend and match the transaction numbers. Is there a option doing this the way described above?!


texts:
If I want to override a controller in my custom module am I able to use existing functionality of default controller in magento 2.
If yes then how?