texts: I created two dynamic fields in admin but one of them not working in Magento 2?

texts:
Here I set two dynamic fields in one configuration but second dynamic field does not work

My system.xml file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="ccc" translate="label" sortOrder="10">
            Checkout Restriction
        </tab>

            <class>separator-top</class>
            Restriction
            <tab>ccc</tab>
            <resource>Ccc_CheckoutRestriction::restriction_config</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                General Configuration
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    Limit Cart Module Enable
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="min_qty_allow" translate="label" sortOrder="2" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    Minimun Qty Allowed
                    <backend_model>Ccc\CheckoutRestriction\Block\Adminhtml\Config\Backend\ArraySerialized</backend_model>
                    <frontend_model>Ccc\CheckoutRestriction\Block\Adminhtml\MinqtyAllow</frontend_model>
                </field>
                <field id="min_msg" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="0" showInStore="0">
                    Add Minimum Quantity Alert Message
                </field>
                 <field id="max_qty_allow" translate="label" sortOrder="4" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    Maximun Qty Allowed
                    <backend_model>Ccc\CheckoutRestriction\Block\Adminhtml\Config\Backend\ArraySerialized</backend_model>
                    <frontend_model>Ccc\CheckoutRestriction\Block\Adminhtml\MaxqtyAllow</frontend_model>
                </field>
                <field id="max_msg" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="0" showInStore="0">
                    Add Maximun Quantity Alert Message
                </field>

            </group>

    </system>
</config>


texts: Urldecode bug: after adding a simple product to shopping cart on search page and redirect to current page

texts:
With Magento 1.7.0.2 If you are on catalog search page and list mode is on.

Url:  http://127.0.0.1/magento_test/catalogsearch/result/index/?mode=list&q=camera

And redirect to current page after adding product to cart is Active in admin panel.

If you try to add simple product to cart, product added to cart successful but redirection URL is not decoded properly

All ‘&’ replaced by ‘&amp;’ and result in breaking search result...

Result URL: http://127.0.0.1/magento_test/catalogsearch/result/index/?mode=list&amp;q=camera

I know this file is responsible, In this fle app\code\core\Mage\Core\Helper\Abstract.php public function escapeUrl($data)

It use htmlspecialchars function of php which replace & with &amp;

So if there is any solution for this, can it safe to remove htmlspecialchars from this function?

This bug is resolved or not?

For what I do now to fix this issue is I have ovewrite my Cartcontroller _goBack function which call this->getResponse()->setRedirect($returnUrl); so for now I have put my custom url redirect.


texts: How to display html content in notification message (success for example)

texts:
I am trying to put html content in a success message when the account is updated such as:

            $successMsg = '
Your request to change your data has been registered.

For further questions, please feel free to contact us
';
$session->addSuccess($successMsg);

The problem is that the html is not interpreted. I have tried to encode the html characters but without success.

Any ideas?
Thanks in advance.


texts:
When I try to add images to the wysiwyg editor on a product I get a url like below

https://domain.co.uk/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvc3F1YXJlX2JveF93ZWxkXzEuanBnIn19/key/d572120a6df9ab6f1c29f11eec2a1059c1ea6a76caadd2ede6cc2396664ab65d/

Needless to say these images don't display, what is happening? How do I fix this?


texts:
We are working on Magento ver 2.2.3 and inserted a logo into transactional emails, but it never work.

We have the same error over and over, we tried to look on the vendor theme path, (there is not header.html, could be that the error?


texts:
we have multi vendor site and we gave an option for vendor to update product information from frontend.
we are using following code for price.

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
        $id= $this->getRequest()->getParam('id');
        $customerid=Mage::getSingleton('customer/session')->getCustomerId();
        $collection_product = Mage::getModel('marketplace/product')->getCollection()->addFieldToFilter('mageproductid',array('eq'=>$id))->addFieldToFilter('userid',array('eq'=>$customerid));

        try{
        $upd_price = $this->getRequest()->getParam('price');
        $product = Mage::getModel('catalog/product')->load($id);
        $product->setPrice($upd_price);

        $product->save();

        echo $price = $product->getPrice();
        echo $name = $product->getName();

        $response['message'] = 'Your Product Is Been Sucessfully Updated';
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));

        }catch(Exception $e){
        echo "Not Saving"; exit;
        Mage::log($e->getMessage());
        }

      }

we are using similar code for quantity and its not working fine

$id= $this->getRequest()->getParam('id');
        $customerid=Mage::getSingleton('customer/session')->getCustomerId();
        $collection_product = Mage::getModel('marketplace/product')->getCollection()->addFieldToFilter('mageproductid',array('eq'=>$id))->addFieldToFilter('userid',array('eq'=>$customerid));

        $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($id);
        $stockItem->setData('manage_stock', 1);
        $stockItem->setData('qty', $this->getRequest()->getParam('qty'));

        $stockItem->save();

        $response['message'] = 'Your Product Is Been Sucessfully Updated';
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));

      }

we are using following code to update both price and quantity. only price is working, quantity is not updating.

public function massupdatesellerproAction(){
      if($this->getRequest()->isPost()){
        if(!$this->_validateFormKey()){
             $this->_redirect('marketplace/marketplaceaccount/myproductslist/');
        }
        $ids= $this->getRequest()->getParam('product_mass_update');
        $price= $this->getRequest()->getParam('price');
        $qty = $this->getRequest()->getParam('qty');

        foreach ($ids as $key => $value) {
    $product = Mage::getModel('catalog/product')->load($value);

    $product->setPrice($price[$key]);
    $product->setQty($qty[$key]);
    $product->save();
        }
        Mage::getSingleton('core/session')->addSuccess( Mage::helper('marketplace')->__('Products has been sucessfully deleted from your account'));
        $this->_redirect('marketplace/marketplaceaccount/myproductslist/');

    }}


texts: Magento2 Circular Depedency when reading config

texts:
I cannot use ScopeConfigInterface $scopeConfig when extending certain objects

di.xml

<preference for="Magento\Framework\Logger\Monolog" type="Foo\Log\Logger\FooLog" />

<virtualType name="helper" type="Foo\Log\Helper\Data" />

       <type name="Foo\Log\Logger\FooLog">
          <arguments>
             <argument name="helper" xsi:type="object">Foo\Log\Helper\Data</argument>
          </arguments>
       </type>

FooLog.php

    public function __construct(
     \Foo\Log\Helper\Data $dataHelper
   )
    {
        $this->_scopeConfig = $scopeConfig;
    }

Data.php

public function __construct(ScopeConfigInterface $scopeConfig)
{
    $this->_scopeConfig = $scopeConfig;
}

$this->_scopeConfig->getValue('dev/debug/foo_bar_config', 'default');

Error:

Circular dependency: Magento\Store\Model\ResourceModel\Config\Collection\Scoped depends on Magento\Store\Model\ResourceModel\Config\Collection\Scoped and vice versa.

I can't even get existing configs like in CreateOrder.php

 $this->scopeConfig->getValue(self::CONFIG_PATH_MERCHANT_ID, $this->sessionQuote->getStoreId());

The issue is, that using ScopeConfigInterface $scopeConfig is only not possible to use for certain objects, if I try to extend some other objects like

 <preference for="Magento\Cms\Controller\Index\Index" type="Foo\Log\Helper\Data" />

it works

*UPDATE

Tried with proxy class - success

<type name="Foo\Log\Helper\Data">
    <arguments>
        <argument name="configinterface" xsi:type="object">Magento\Framework\App\Config\ScopeConfigInterface\Proxy</argument>
    </arguments>
</type>

Data.php

        public function __construct(
    \Magento\Framework\App\Config\ScopeConfigInterface\Proxy $scopeConfig)
            {
                $this->_scopeConfig = $scopeConfig;
               $host =  $this->_scopeConfig->getValue('dev/debug/remote_server_host');
               // error after getValue
            }
}


texts: create mini wish list icon like mini cart

texts: I am in requirement to add mini wish-list icon like mini cart count on top of header .I do not know  this is Magento default functionality or Not.


texts: Alternative Category layout at different url

texts:
I have a store setup with a top level category called Products, containing multiple sub-categories, and products have both the Products category and a sub-category assigned.  list.phtml is set up such that it displays all products broken up into sub-categories if you are viewing the top level Products category, or just the products in the particular sub-category otherwise.

The client would like Wholesale users to have the option of a different layout for the Products category page.  So at /products.html, they will see what any visitor sees, but then at /wholesale.html, they will see all of the same products from the Products category, but in a different layout (probably showing the appropriate price tier and password protected so only wholesale group members can see it).

I'm still pretty new to Magento, and don't know how to create this alternate layout/url that displays all of the items in Products.  Would someone advise me on how to proceed?


texts: magento 2.1.1 - UPS shipping only populates in chrome browser - not fire fox or IE

texts: when I use IE or Firefox UPS shipping is not populating, Google Chrome its working like it suppose to, any idea how I can troubleshoot this? shopping cart page it populates in all browsers, but it wont populate in checkout page using IE or Firefox. when I refresh the page it shows for brief second and then it disappears.


texts: Cron jobs not being called, getting email notification errors

texts:
I've been having a hard time getting my cronjobs working for my new magento 1.9.2.3 install.  I added a mailto along with my cron call in crontab and i've been getting back error messages like this:

PHP:  syntax error, unexpected '(' in /usr/local/lib/php.ini on line 3
X-Powered-By: PHP/5.5.31
Content-type: text/html

Fatal error:  Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in /home/kegel4/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php:344
Stack trace:
#0 /home/kegel4/public_html/lib/Zend/Db/Adapter/Abstract.php(248): Zend_Db_Adapter_Pdo_Abstract->setFetchMode(2)
#1 /home/kegel4/public_html/app/code/core/Mage/Core/Model/Resource.php(175): Zend_Db_Adapter_Abstract->__construct(Array)
#2 /home/kegel4/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#3 /home/kegel4/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#4 /home/kegel4/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#5 /home/kegel4/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Mo in /home/kegel4/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 344


texts:
We have this issue with a few M1 sites.
The PayPal logo is not showing up on checkout.

The requested URL is

https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecshortcut&locale=en_US` and it just returns an `ERR_CONNECTION_RESET

This happened a few times and tends to resolve itself on it's own.
The first time this happened we figured something was up with PayPal's servers but now it's happening very frequently.

We can switch out the image and just call a local image but we'd rather not - love the problem not the solution.


texts: How to get target url for entity before rewrite?

texts:
Suppose I want to open contact page: {website}/contact, this page is also represented like {website}cms/page/view/id/12.

Is it possible to get somehow to get this url ({website}cms/page/view/id/12)? I'm trying to get it from request object, but without success.

UPD

Maybe I was to abstract. When I'm on some page: product, blog, cms, I need some unique value which will identify this page when I'll open it. Every time. I thought it can be such kind of url.


texts: Possibility of creating order programatically without quote

texts: Has anyone checked wheter it is possible to add order programatically without creation of quote?


texts:
I am trying to find how I can resolve a magento issue, from what I can see when Im listing a bundle product in magento, I click 'bundle items' which does an ajax post and retrieves the data. The actual request to mysql requests all the simple product id's, because we have in excess of 15,000 simple products, this load time is around 37 seconds.

Im looking for suggestions to lead me in the right direction, to remove the query and be lead to a different method.


texts: Auto generate meta description for impoted products

texts:
I've create a module for Auto generate of meta description but it's not workin for imported products but i want this also work for imported product and I am using an extension instead of Magento's default import/Export.

app/code/local/Easylife/Meta/etc/config.xml

<?xml version="1.0"?>
<config>
<modules>
<Easylife_Meta>
<version>0.0.1</version>
</Easylife_Meta>
</modules>
<global>
<models>
<easylife_meta>
<class>Easylife_Meta_Model</class>
</easylife_meta>
</models>
</global>
<adminhtml>
<events>
<catalog_product_save_before><!-- observe the event -->
<observers>
<easylife_meta>
<class>easylife_meta/observer</class>
<method>autoMetaDescription</method>
</easylife_meta>
</observers>
</catalog_product_save_before>
</events>
</adminhtml>
</config>

app/code/local/Easylife/Meta/Model/Observer.php

<?php
class Easylife_Meta_Model_Observer {
public function autoMetaDescription($observer) {
$product = $observer->getEvent()->getProduct();

$meta_description = $product->getMetaDescription();
$attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$attributeSetModel->load($product->getAttributeSetId());
$attributeSetName = $attributeSetModel->getAttributeSetName();

if ($meta_description == '' || $meta_description == null)
{

if($attributeSetName == "Books"){
$publisher_attribute = $product->getResource()->getAttribute('publisher');
$metaDescription = "Buy ". $product->getName()." for Rs ".number_format($product->getFinalPrice(), 2)." at booksnclicks.com | Buy New Book | Authorised seller for ".$publisher_attribute->getFrontend()->getValue($product);
$product->setMetaDescription($metaDescription);
}

if($attributeSetName == "Gadgets"){
$metaDescription = "Buy ". $product->getName()." for Rs ".number_format($product->getFinalPrice(), 2)." at booksnclicks.com | Buy New Gadgets |Authorised seller for ". $product->getAttributeText('brand_gadgets');
$product->setMetaDescription($metaDescription);
}

if($attributeSetName == "Stationery"){
$metaDescription = "Buy ". $product->getName()." for Rs ".number_format($product->getFinalPrice(), 2)." at sbooksnclicks.com | Buy New Stationery | Authorised seller for ". $product->getAttributeText('brand_stationery');
$product->setMetaDescription($metaDescription);
}

}

}
}


texts: I have installed magento1.9.2 but the admin page is not loading properly.  The Css and Java script is not loading.


texts: How to configure if one of the Shopping Cart Price Rule applied Product A no other shopping cart apply for same Product A?

texts: Once the shopping cart price rule applied, remaining shopping cart price rule not going to apply for same products.


texts:
I'm trying to get 4 random products on the homepage using PHP within a TPL file I've created. I'd like to be able to format the products in a foreach loop as I'm using some formatting in the code seen below...

      <img src="<?php echo $this->getSkinUrl('images/products/place_holder.jpg'); ?>" alt=" ">

      240 Serving Package

$454.99

      Free shipping for this package

      ADD TO CART

I've tried a few things found on Google but no luck yet. Setting categories in an array would certainly work for what I'm trying to do but it'd also work if the categories were random.

Thanks!


texts:
I am having issue with setting up website on https from http. I am using Magento ver. 2.1.9.

Current Settings:
web/unsecure/base_url --> http:// .......
web/secure/base_url --> https://...........
web/secure/use_in_frontend --> 1
web/secure/use_in_adminhtml --> 1

Issue
Magento admin login page -- The page is redirecting too many times.

Magento Front -- All the URLs like navigation links & form actions are still using http. And customer login page is redirecting too many times which leads to page crash.

Thanks in advance


texts: how to find the correct alias for layered navigation filters

texts:
I need to select what filter should appear for every category and sub category.
the problem is that if I leave all the filters in the parent categories  the website is too confusing to browse, also I have more than a filter with the same name in a single category.
After a lot of unsuccesfull attempts I've found that using :

<reference name="catalog.leftnav">
</reference><action method="unsetChild"><alias>category_filter</alias>
</action>

in the custom design tab of every categories does the trick to remove the "category_filter" , so I would like to use it for removing other filters that I do not want.

This soultion could be perfect beacuse I have a complete control of what filter I wanted to show, and unset unwanted filters from viewing.

Unfortunately all the alias that I tried ( looking in the attribute menu and trying both 'attribute alias' and 'attribute alias_filter' ) are not working.
there is a way to discover the correct alias?
also, is this a correct way to do this?


texts: how to pass customer id(value) ,name(label) as options to multiselect field

texts:
I have client requirement like this.I need to get all customers in multiselect field.
and I'm writing following code

public function getAllOptions($withEmpty = true, $defaultValues = false){
    if (is_null($this->_options)) {
    $collection = Mage::getResourceModel('customer/customer_collection')
               ->addNameToSelect();

        $this->_options = $collection->toOptionArray();

        }
        return $this->_options;

    }

and its giving only names as option labels in multi-select field. But option value fields are empty.

And extra functions are,

public function getOptionsArray($withEmpty = true) {
        $options = array();

        foreach ($this->getAllOptions($withEmpty) as $option) {

        $options[$option['value']] = $option['label'];
    }
    return $options;
}
/**
 * get option text
 * @access public
 * @param mixed $value
 * @return string
 * @author Ultimate Module Creator
 */
public function getOptionText($value) {
    $options = $this->getOptionsArray();
    if (!is_array($value)) {
        $value = array($value);
    }
    $texts = array();
    foreach ($value as $v) {
        if (isset($options[$v])) {
            $texts[] = $options[$v];
        }
    }
    return implode(', ', $texts);
}


texts: Using URL subfolders for multi-language Store Views in Magento 2

texts:
I configured Magento 2 with two Store Views in order to have two front-end languages (English and Italian) and I would like to have the following behaviour:

http://example.com/     -->  Store View "English" (code = "en") - Default
http://example.com/it/  -->  Store View "Italian" (code = "it")

That is, the English Store View should be available on standard urls and the Italian Store View should be available within the "it" subfolder in the url. Nothing strange, a common configuration for multilanguage websites.

I found here a quite similar question regarding Magento 1.x: Different storeviews or websites in subfolders. But since the accepted answer is not trivial (it involves rewrites in the .htaccess and modifications in the index.php), I would like to ask if with Magento 2 there is a simpler way to get this done?

UPDATE

Premise: I don't mind about having multiple websites so I don't have the problem to having several websites with the same languages (that would be a problem for the below solution).

So I enabled the Add Store Code to Urls option, from Configuration > Web > Url > Add Store Code to Urls, and it's working good. But now I have duplicated urls for the default language (English):

http://example.com/     -->  Store View "English" (code = "en")
http://example.com/en/  -->  Store View "English" (code = "en")
http://example.com/it/  -->  Store View "Italian" (code = "it")

Is there a way to avoid this, i.e. avoid the subfolder in the url for the default language?


texts: Upgrading Magento EE 1.13.1.0 to EE 1.14

texts:
I wish to upgrade my Magento Enterprise Edition with version 1.13.1.0 to the latest 1.14 - and I can not seem to find any documentation on how to perform the upgrade from 1.13.1.0.

Can someone please share with me any of their experiences they've had with doing this particular upgrade?

Can someone point me to the correct upgrade article?


texts: Magento 2 How to add barcode to shipment PDF

texts:
I want to add barcode of Tracking Number in to my shipment PDF without use of any third party extenssion.

Can any one help me to how to generate barcode in to PDF in magento 2, is there any default magento function to achieve this things.

Any help would be Appreciated! Thanks.


texts: How AuthorizationLink Block is not cached in Magento 2

texts: I have created a block which is having login and account link. if customer is logged out it will show login link. if the customer logged in it will show logout url. If i enable the full page it is not working properly. Even if modify in that it is not getting reflected. Then i put cacheable="false" it works fine. But if i put cacheable="false" entire page become not cacheable. In default customer login link ( Magento\Customer\Block\Account\AuthorizationLink ) does not use any cacheable="false". How is that working?


texts: Construct a method name for customer object dynamically

texts:
I have a Magento website with four stores. For each customer different cut off time will be assigned for each store.

User is restricted to add product from only one store at a time. When user come to check out page I have to get the cut off time for the store from which he added the product.

I managed to get the store code.

Customer attributes for store cut off time are as below

`delivery_cutoff_time_abc` // here abc is the store code
`delivery_cutoff_time_def` // here def is the store code
`delivery_cutoff_time_ghi` // here ghi is the store code
`delivery_cutoff_time_jkl` // here jkl is the store code

Based on products added to cart I got the Store code whether it itsabc or def or so.

Now I have to get the value from customer object as below

$customer = Mage::getSingleton('customer/session')->getCustomer();
$customer->getDeliveryCutoffTimeAbc();

For doing this I have store code as below

$storeCode = "abc";

I have to use dynamic as below

$customer->getDeliveryCutoffTime.$storeCode();

It doesn't get the value. How may I make it dynamic?


texts: Magento 2 : Dropdown Option not Showing in Admin Form

texts:
I add dropdown field in admin form to showing status enable or disable like this :

<field name="status">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" translate="true" xsi:type="string">Status</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="options" xsi:type="string">Lime\Confirmation\Model\Status</item>
                    <item name="source" xsi:type="string">bank_destination</item>
                    <item name="sortOrder" xsi:type="number">130</item>
                    <item name="dataScope" xsi:type="string">status</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                    </item>
                </item>
            </argument>
        </field>

It calls Model/Status for options label and value. When I load page dropdown not showing any label and value as option. Here's the Model/Status.php:

namespace Lime\Confirmation\Model;

class Status implements \Magento\Framework\Option\ArrayInterface
{
    /**
     * Retrieve options array.
     *
     * @return array
     */
    public function toOptionArray()
    {
        $result = [];

        foreach (self::getOptionArray() as $index => $value) {
            $result[] = ['value' => $index, 'label' => $value];
        }

        return $result;
    }

    /**
     * Retrieve option array
     *
     * @return string[]
     */
    public static function getOptionArray()
    {
      return [
          '1' => 'Active',
          '0' => 'Inactive',
      ];
    }

    /**
     * Retrieve option array with empty value
     *
     * @return string[]
     */
    public function getAllOptions()
    {
        $result = [];

        foreach (self::getOptionArray() as $index => $value) {
            $result[] = ['value' => $index, 'label' => $value];
        }

        return $result;
    }

    /**
     * Retrieve option text by option value
     *
     * @param string $optionId
     * @return string
     */
    public function getOptionText($optionId)
    {
        $options = self::getOptionArray();

        return isset($options[$optionId]) ? $options[$optionId] : null;
    }
}


texts: Magento 2: how to upsell block move before product.info.details block

texts:
How Add after/before positioning in pre existing xml block
How to upsell block move before product.info.details block

<block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.upsellslider" template="Magento_Catalog::product/list/upsell.phtml">
      <arguments>
          <argument name="type" xsi:type="string">upsell</argument>
     </arguments>
</block>


texts: Magento CE 1.9.1.1 database connect error during install

texts:
CE 1.9.1.1: Without a shadow of a doubt the db and dbu credentials are correct. I see an article on the subject here: http://www.appseconnect.com/magento-community-1-9-fresh-installation-problems-and-solutions/ |but I'm not confident in my ability to interpret these instructions.

Can anyone tell me specifically how to get around this apparent Innodb requirement? I'm installing on a live server / new site so I wonder if I can ftp to the correct files or access via cPanel. I am not skilled in ssh.

Thanks in advance!


texts: Shopping Cart Rule - exclude items already on sale?

texts:
I'm trying to apply a rule to app products in a couple categories, except for those that are currently on sale.

In this example: sale runs from 3/26/14 to 3/31/14

Under Actions, I've got it to apply when:

If ALL of these conditions are TRUE :
   -Category is one of 9, 10, 11      //These are the products affected by the rule.
   -If ANY  of these conditions are TRUE :
      -Special Price From Date equals or greater than 2014-04-01
      -Special Price To Date equals or less than 2014-03-25
      -If ALL of these conditions are FALSE :
        -Special Price equals or greater than 0.01

The latter part says:

The "special price to date" is the day before the cart rule begins. So if it was on sale, it's checking to make sure that sale has expired.
The "special price from date" is the day after cart rule ends. So the rule applies to things that will be on sale in the future, but aren't yet.
The 'special price' at the end, checks to see if the special price field is blank. If it's blank, the item isn't/wasn't/won't-be on sale.

So why is my rule applying to items that it shouldn't?

Extra info: There are some items that have a special price start date but no end date, and some that have both start & end dates. But it seems to be applying to all of them equally.


texts: Cron jobs are affected due to system upgrade error in magento 2. Did any one face this kind of issue?

texts:
Recently we upgraded to 2.3.3 to 2.3.5-p1. Most of of cron jobs are get affected with error message as "The job is terminated due to system upgrade"

Even though I commented out update/cron.php in crontab, still this issue coming. We are not sure what is this issue about and why it keep occurring. Magento also not provided a correct answers for this issue.
Any one faced such kind of issue?


texts: magento 2: display cms static page content in phtml file

texts:
I have a static cms page. I want to display that page content in my phtml file. Is there way to do this by using that page identifier?

I did something like that for cms blocks.

echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('my_block')->toHtml();


texts: I need to create a module which can allow a user to change the string used on the front end for delivery methods and use existing delivery methods from another module. I've got a decent idea of how to the conversion and everything, but I don't know what observer event I should be using to catch the order once it's been submitted. Does anyone know which one will let me catch the order before it's placed?


texts: Applied Coupon title "Discount" is not translating on cart & checkout Magento2

texts:
Applied Coupon code title Discountis not translating in Magento2,
even if we applied the Extra Fee, that is not translating, rather then this everything is translating properly.

for more please see my screen shot.


texts:
I am currently running Magento 2.3.2. The process went smoothly but after installing some extensions, it appears that some of the reindex tables have been deleted. This is the message I get when trying to reindex:

Design Config Grid indexer process unknown error:
Table status for `design_config_dummy_cl` is incorrect. Can`t fetch version id.
Customer Grid indexer process unknown error:
Table status for `customer_dummy_cl` is incorrect. Can`t fetch version id.
Category Products indexer process unknown error:
Table status for `catalog_category_product_cl` is incorrect. Can`t fetch version id.
Product Categories indexer process unknown error:
Table status for `catalog_product_category_cl` is incorrect. Can`t fetch version id.
Catalog Rule Product indexer process unknown error:
Table status for `catalogrule_rule_cl` is incorrect. Can`t fetch version id.
Product EAV indexer process unknown error:
Table status for `catalog_product_attribute_cl` is incorrect. Can`t fetch version id.
Stock indexer process unknown error:
Table status for `cataloginventory_stock_cl` is incorrect. Can`t fetch version id.
Inventory indexer process unknown error:
Table status for `inventory_cl` is incorrect. Can`t fetch version id.
Catalog Product Rule index has been rebuilt successfully in 00:00:14
Product Price indexer process unknown error:
Table status for `catalog_product_price_cl` is incorrect. Can`t fetch version id.
Catalog Search indexer process unknown error:
Table status for `catalogsearch_fulltext_cl` is incorrect. Can`t fetch version id.

Even after using the reset function then reindexing giving same error.
Is there a way to resolve this issue?


texts: Access Denied errors after installing security patches

texts:
i created some user and roles in magento

i logged in with that username and password.

but i am getting message "Access Denied".

it was working before, after we installed the security patches , it happened.

i found solution here : Access Denied errors after installing SUPEE-6285

but i did't understood the line here :

"The only solution is to patch the extensions and add this method to all their admin controllers:" means is i have to add that code in controllers? if so i want to know in which file i need to add...

please explain me what actually i need to solve this


texts: I'm new in Magento and I'm still learning how to deal with blocks. I am trying to add a form on an existing page (Product view for example). I'm trying to do that by adding a block with my form. But I don't know how to do that. Can anyone help me?


texts:
I'm looking to build a pricing calendar for each product (i.e. be able to plan in advance pricing for products).

Has anyone had any experience building something like this, or does anyone have any ideas on best practices to implement this?


texts: How to get ordered items in observer for "sales_order_place_after" event?

texts:
I am trying to get ordered items in sales_order_place_after event,
but i am not able to log the ordered items.
Here is the code which i have used.
<?php

namespace Vendor\Module\Helper;

use Magento\Directory\Model\Currency;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Store\Model\StoreManagerInterface;
use Segment;

class Tracking extends AbstractHelper
{
    /**
     * @var SearchCriteriaBuilder
     */
    protected $searchCriteriaBuilder;

    /**
     * @var OrderRepositoryInterface
     */
    private $orderRepository;
    private $segment;
    private $currency;
    private $storeManager;

    public function __construct(
        \Magento\Framework\App\Response\RedirectInterface $redirect,
        \Magento\Framework\View\Page\Title $pageTitle,
        StoreManagerInterface $storeManager,
        Currency $currency,
        SearchCriteriaBuilder $searchCriteriaBuilder,
        OrderRepositoryInterface $orderRepository,
        \Segment $segment
    ) {
        $this->redirect              = $redirect;
        $this->_pageTitle            = $pageTitle;
        $this->_segment              = $segment;
        $this->searchCriteriaBuilder = $searchCriteriaBuilder;
        $this->orderRepository       = $orderRepository;
        $this->storeManager          = $storeManager;
        $this->currency              = $currency;
    }
    /**
     * @param object $order
     * Process order data & track order completed event
     */
    public function trackOrderCompleted($order)
    {
        if (!$order) {
            return;
        }

        $orderItems = array();

        $searchCriteria = $this->searchCriteriaBuilder
            ->addFilter('increment_id', $order['increment_id'])->create();
        $orderData = [];
        $order     = $this->orderRepository->getList($searchCriteria);
        if ($order->getTotalCount()) {
            $orderData = $order->getItems();
        }
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/orderData.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info($orderData);
        print_r($orderData);exit;
    }
}


texts: What are the security risks if we allow the user to login on the paypal review page?

texts:
I want some expert opinions on the requirement/customization as following(I am my self personally do not want this to implement this, but need suggestion so that I can explain in a better manner to someone non technical or ordinary user)

"suppose I customize to  allow the user on the paypal express checkout review page to login what can be the abnormal behaviour of the system and security risks associated with this. "

AS I know that the payment process is already in the middle and allow a user to login in this stage in not correct technically.

Please suggest.


texts: Exception after bin/magento setup:di:compile and adding virtualType

texts:
I was adding this:

<virtualType name="Test\Faq\Model\ResourceModel\VisitStat\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="const">\Test\Faq\Setup\Operation\CreateViewStatTables::TABLE_NAME</argument>
        <argument name="resourceModel" xsi:type="string">Test\Faq\Model\ResourceModel\VisitStat</argument>
    </arguments>
</virtualType>

instead this class:

<?php

namespace Test\Faq\Model\ResourceModel\VisitStat;

use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Psr\Log\LoggerInterface as Logger;
use Test\Faq\Setup\Operation\CreateViewStatTables;
use Test\Faq\Model\ResourceModel\VisitStat;

class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
{
    public function __construct(
       EntityFactory $entityFactory,
       Logger $logger,
       FetchStrategy $fetchStrategy,
       EventManager $eventManager,
       $mainTable = CreateViewStatTables::TABLE_NAME,
       $resourceModel = VisitStat::class
   ) {
       parent::__construct(
           $entityFactory,
           $logger,
           $fetchStrategy,
           $eventManager,
           $mainTable,
           $resourceModel
       );
   }
}

But after that, when I was compiling di, I see that:

  [ReflectionException]
  Class Test\Faq\Model\ResourceModel\VisitStat\CollectionFactory does
  not exist

  Class Test\Faq\Model\ResourceModel\VisitStat\CollectionFactory does
  not exist

  Source class "\Test\Faq\Model\ResourceModel\VisitStat\Collection"
  for "Test\Faq\Model\ResourceModel\VisitStat\CollectionFactory"
  generation does not exist.


texts: We do not have our password, cannot access our account!

texts:
the folks who installed Magento on our website are long gone. The assistant who had the login info is now gone and did not leave the login info. I am new here, need to make some changes to our website and need to access our Magento/admin area but have no password and seemingly no way to have it emailed to myself as my email is not associated with the account. We already have an account and use Magento daily for sales of our company. Can anyone help with this? I can't even get in to our account, to be able to change the password!
Thanks


texts: I want to override the css for  tag globally, it is not enclosed so I want to apply word-wrap property on it. Any help?


texts: Override/disable 3rd party plugin (Amasty Shop By) which is not declared

texts:
I've been battling with this one for a while but can't figure out how to disable, in order to override, a plugin in the Amasty Shop by extension. I need to override a couple of methods in the plugin, but as they're set to private and use private variables declared within the class, I think I have to just disable that specific plugin and override it with my own.

The issue I have is that the plugin doesn't appear to be declared/named in the di.xml files present in the extension, but there are some additional plugins in the extension which extend it, and these plugins are named in di.xml.

The plugin I am trying to override is here: vendor/amasty/shopby/Plugin/Ajax/Ajax.php

There are 2 plugins (in the same directory as the above) which extend it, and are named in vendor/amasty/shopby/etc/frontend/di.xml as below:

<type name="Magento\Catalog\Controller\Category\View">
        <plugin name="Amasty_Shopby::ajaxInject" type="Amasty\Shopby\Plugin\Ajax\CategoryViewAjax"/>
    </type>

I've created and registered my module, and my attempt to disable and override the plugin is as follows:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Amasty\Shopby\Plugin\Ajax\Ajax">
        <plugin name="Amasty\Shopby\Plugin\Ajax\Ajax" disabled="true" />
        <plugin name="my_ajax" type="MyNamespace\Shopby\Plugin\Ajax\Ajax" />
    </type>
</config>

It's likely I'm missing something obvious here, grateful for any pointers in the right direction.


texts: Add custom textarea field to product form (admin)

texts:
I want to add a custom product attribute to the product form in the admin area.

https://devdocs.magento.com/guides/v2.2/howdoi/customize-form-configuration.html and https://devdocs.magento.com/guides/v2.1/ui_comp_guide/concepts/ui_comp_xmldeclaration_concept.html, but I do not get it yet.

As far as I understand the documentation, all that's necessary is a new app/code/Mycompany/Catalog/view/adminhtml/ui_component/product_form.xml file. Mine looks like this:

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="mycompany">
        <field name="my_field_name">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string">My Field Name</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">product[my_field_name]</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">textarea</item>
                    <item name="sortOrder" xsi:type="number">15</item>
                    <item name="source" xsi:type="string">product</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

My field appears, but does not store data when I submit the form via the "save" button. How can I make it store data?

Edit: This is my setup script:

/**
 * Adds my_field_name attribute if it does not exists already.
 *
 * {@inheritdoc}
 *
 * @codingStandardsIgnoreStart
 */
public function addMyFieldNameAttribute(ModuleDataSetupInterface $setup)
{
    //codingStandardsIgnoreEnd
    /**
     * @var \Magento\Catalog\Setup\CategorySetup
     */
    $catalogSetup = $this->categorySetupFactory->create(['setup' => $setup]);
    $catalogSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'my_field_name',
        [
            'group' => 'General',
            'type' => 'text',
            'label' => 'My Field Name',
            'input' => 'textarea',
            'class' => '',
            'source' => \Magento\Eav\Model\Entity\Attribute\Source\Boolean::class,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'visible' => true,
            'required' => false,
            'user_defined' => 1,
            'default' => '',
            'apply_to' => '',
            'visible_on_front' => false,
            'is_html_allowed_on_front' => true,
            'used_in_product_listing' => true,
            'is_used_in_grid' => false,
            'is_visible_in_grid' => false,
            'is_filterable_in_grid' => false,
        ]
    );
}


texts: What is meant for Vanila magento 1 codebase?

texts:
I am trying to migrate from magento 1 to magento 2 and I have seen on magento website there is a tool for that which is code migration toolkit here's link for the same https://github.com/magento/code-migration.

In the prerequisite directories section it is saying about vanila magento 1.x code base. I don't have any idea what is meaning of vanila codebase. Please guys help me to solve this problem


texts: Update Product Attribute Options via API

texts:
I am currently using Magento 2 api to add new product attribute with option if the type is right. When I am using the type dropdown and add some option how can I update them with the api. Their is only a POST no PUT.

Thank you.


texts:
Here is what i have tried
i am trying to override Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php
block
Config.xml
<?xml version="1.0"?>
<config>
    <modules>
        <vendor_module>
            <version>
                0.1.0
            </version>
        </vendor_module>
    </modules>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_create_items_grid>
                        Vendor_Module_Adminhtml_Block_Sales_Order_Create_Items_Grid
                    </sales_order_create_items_grid>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

Vendor/Module/Block/Adminhtml/Sales/Order/Create/Items/Grid.php
<?php

class Vendor_Moduley_Adminhtml_Block_Sales_Order_Create_Items_Grid extends Mage_Adminhtml_Block_Sales_Order_Create_Items_Grid
{
    /**
     * Flag to check can items be move to customer storage
     *
     * @var bool
     */
    protected $_moveToCustomerStorage = true;

    /**
     * Class constructor
     */
    public function __construct()
    {
        parent::__construct();
        $this->setId('sales_order_create_search_grid');
    }

    /**
     * Returns the items
     *
     * @return array
     */
    public function getItems()
    {
        echo'check'; exit;
    }
}

Any thoughts what's wrong here ?


texts: Magento2 Payment methods render list missing on custom Checkout module

texts:
I'm modifying all Magento 2 to accept login with mobile phone instead of email. Register, login, account info, backend, login at checkout, everything is going well.

But when I use my own checkout_index_index.xml instead of the core one, the object which stores the list of renders of each payment method (rendererList) is not filled in.

In the moment of the checkout, using the original checkout_index_index.xml I got this when I debug list.js:

rendered list in the beginning >>
[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object] list.js:30

Using my checkout_index_index.xml:

rendered list in the beginning >>
[] list.js:30

The object with the payment methods in both situations:

[Object, Object, Object, Object]
0: Object
method: "paypal_express"
title: "PayPal Express Checkout"
__proto__: Object
1: Object
method: "purchaseorder"
title: "Purchase Order"
__proto__: Object
2: Object
method: "checkmo"
title: "Check / Money order"
__proto__: Object
3: Object
method: "free"
title: "No Payment Information Required"
__proto__: Object
length: 4
__proto__: Array[0]

So, the rendererList used in list.js to render each payment method for my custom module is empty. I spend a whole day trying to find where does this object is filled in without success.

I must say I'm editing checkout_index_index.xml to use my own js files on checkout steps like this:

<item name="component" xsi:type="string">Tmo_Checkout/js/view/shipping</item>
     <item name="provider" xsi:type="string">checkoutProvider</item>
     <item name="sortOrder" xsi:type="string">1</item>
     <item name="children" xsi:type="array">
           <item name="customer-email" xsi:type="array">
                <item name="component" xsi:type="string">Tmo_Checkout/js/view/form/element/username</item>
                <item name="displayArea" xsi:type="string">customer-email</item>
                <item name="tooltip" xsi:type="array">
                      <item name="description" xsi:type="string" translate="true">We'll send your order confirmation here.</item>
                </item>
                <item name="children" xsi:type="array">
                      <item name="before-login-form" xsi:type="array">
                      <item name="component" xsi:type="string">uiComponent</item>
                      <item name="displayArea" xsi:type="string">before-login-form</item>
                      <item name="children" xsi:type="array">
                            <!-- before login form fields -->
                      </item>
               </item>
               <item name="additional-login-form-fields" xsi:type="array">
                   <item name="component" xsi:type="string">uiComponent</item>
                   <item name="displayArea" xsi:type="string">additional-login-form-fields</item>
                   <item name="children" xsi:type="array">
                      <!-- additional login form fields -->
               </item>
          </item>
     </item>
</item>

Finally, the questions are: how do I fill that rendererList?? or where Magento does it?? or how can I specify custom js files for checkout without touching checkout_index_index.xml?? Thanks in advance!


texts:
Environment: Magento2 2.2.5 / PHP 7.0.28

  Fatal error: Uncaught RuntimeException: Can't create directory /opt/lampp/htdocs/Procfit-Institucional/generated/code/Magento/Framework/App/ResourceConnection/. in [Magento\Framework\App\ResourceConnection\Proxy] in /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/Code/Generator.php:115 Stack trace: #0 /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Framewo...') #2 [internal function]: spl_autoload_call('Magento\Framewo...') #3 /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...') #4 /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #5 /opt/lampp/htdocs/Procfit-Institucion in /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/Code/Generator.php on line 115

I already tried:

sudo chmod 777 -R on my root project
sudo chmod -R 777  var/*


texts: "A joint field with this alias (bestsellers) is already declared" product sorting Magento

texts:
I am facing this issue on product sorting in product list page. I have few new options in sorting like 'Best Sellers','Best Viewed'. When i used this options for sorting , it is giving me an error "A joint field with this alias (bestsellers) is already declared" or "A joint field with this alias (0) is already declared"

I think this is cache issue. When i disabled cache. its start working but when i enabled cache it throw error.

Code used for that is as follows

For bestseller

public function setOrder($collection, $dir)
    {
        $period = (int)Mage::helper('productsorting')->getConfig('bestsellers_period');
        if ($period) {
            $cond = array(
                'created_at' => array(
                    'gteq' => date('Y-m-d h:i:s', time() - $period * 24 * 60 * 60)
                )
            );
        } else {
            $cond = NULL;
        }

        $collection
            ->joinTable('sales/order_item', 'product_id=entity_id',
                array('bestsellers'=>'SUM(sales_flat_order_item.qty_ordered)'), $cond, 'left')
            ->groupByAttribute('entity_id');

        $collection->getSelect()
            ->order('bestsellers');
    }

For bestviewed

public function setOrder($collection, $dir)
    {
        $period = (int)Mage::helper('productsorting')->getConfig('bestviewed_period');
        if ($period) {
            $cond = array(
                'logged_at' => array(
                    'gteq' => date('Y-m-d h:i:s', time() - $period * 24 * 60 * 60)
                )
            );
        } else {
            $cond = NULL;
        }
        $collection
            ->joinTable('reports/event', 'object_id=entity_id',
                array('COUNT(report_event.event_id) AS bestviewed'), $cond, 'left')
            ->groupByAttribute('entity_id');

        $collection->getSelect()
            ->order('bestviewed ' . Mage::helper('productsorting')->reflectDir($dir));
    }

Please help & tell me what i did wrong.


texts: Magento (1.x) : How to show bootstrap modal popup

texts:
Is there a way to open the bootstrap modal popup in Magento 1.x?
Like: https://www.w3schools.com/bootstrap/bootstrap_modal.asp
I also had a look by ctrl+u but didn't find any bootstrap.min.js (or) bootstrap.min.css.
Do Magento 1.x uses bootstrap?
So is it possible to show a bootstrap modal popup in Magento by default?
Thanks


texts: Date Format by UI component shows wrong date of birth

texts:
I have one new customer attribute for that I have added it in checkout page by extending LayoutProcessor's public function

afterProcess(\Magento\Checkout\Block\Checkout\LayoutProcessor $subject, array $jsLayout){
$customField1 = [
            'component' => 'Magento_Ui/js/form/element/abstract',
            'config' => [
                // customScope is used to group elements within a single form (e.g. they can be validated separately)
                'customScope' => 'shippingAddress.custom_attributes',
                'customEntry' => null,
                'template' => 'ui/form/field',
                'elementTmpl' => 'ui/form/element/date',
                'options' => [
                    'changeYear'=> true,
                    'changeMonth'=> true,
                    'yearRange' => '-120y:c+nn',
                    'maxDate' => '-1d'
                ],
            ],
            'dataScope' => 'shippingAddress.custom_attributes.dob',
            'provider' => 'checkoutProvider',
            'validation' => [
                'required-entry' => false
            ],
            'options' => [],
            'filterBy' => null,
            'customEntry' => null,
            'visible' => true,
            'disabled' => $disabled,
            'value' => "11/6/1997" // value field is used to set a default value of the attribute
        ];
}

But on frontend I can see like this


texts: PDF invoices totals - switch shipping and tax

texts:
My totals are displayed wrong on PDF invoices meaning, my taxes are listed below my shipping. On the cart and in the sales emails is all ok, like:
Price
Tax
Shipping

and only on my PDF invoices it is like

Price
Shipping
Tax

Where are the informations for PDF invoice totals defined?


texts:
I would like to make the product images bigger on the product page

I tried to increase these values in the following file:

  app/design/frontend/danisa/danisa_default/etc/view.xml

        <image id="product_page_main_image" type="image">
            <width>198</width>
            <height>198</height>
        </image>
        <image id="product_page_main_image_default" type="image">
            <width>198</width>
            <height>198</height>
        </image>

But, It doesn't appear to change anything.


texts:
We are getting the following error when sales order data override to custom module

"message": "Missing required argument $resourceClassName of Magento\Sales\Model\ResourceModel\Metadata.",

can anyone help me on this issue


texts:
I need to implement Compare button as a link on product detail page.

What I trying to do:

<a class="btn-compare" onclick="popWin('<?php echo $_helper->getListUrl() ?>','compare','top:0,left:0,width=820,height=600,resizable=yes,scrollbars=yes')"><?php echo $this->__('Compare') ?>

Problem is $_helper->getListUrl()  return strange link:

string 'my.dev/catalog/product_compare/index/uenc/aHR0cDovL2F0ZXguZGV2L2xpY2h0LWlua29vcC9iaW5uZW52ZXJsaWNodGluZy9wbGFmb25kLWluYm91dy90ZWtuaWx1eC03MzQ4NS5odG1s/' (length=160)

it's opening and closing in a second, there no products also.

Link must be my.dev/catalog/product_compate/index/.

Thanks.


texts:
I upgraded My Magento from 1.9.0.1 to 1.9.3.0 and I have no images in the admin panel.

First, browse file button and upload button was disappeared after I copied Media from Magento they came back but doesn't work I don't know how can I solve my problem.

I would be appreciated if help me.

Thanks.


texts:
I am using Magento 2.3 CE on ubuntu 18 with SM Moonlight theme, the issue is when I search any product it shows suggested products but without loading CSS and template.
Here is the image for view https://imgur.com/a/kIlDbfM
It also shows 500 (Internal Server Error)  on the search result page.


texts: How can i add 5% amount on if customer choose Online Payment instead of cod

texts: How can i apply extra fees if customer choose online payment instead of cash on delivery.


texts:
I have added a new sitemap in Google Search Console 4 weeks ago, but at this moment only 1 url is indexed from the 1298 urls total. Is that normal or is something wrong?

Url new sitemap: www.marington.nl/filter_sitemap.xml


texts: how to call newsletter subscription part in a specific page without XML in magento?

texts:
I want to call the newsletter subscription part in a specific page.I don't want it in header.So I turned off it by disabling newsletter.xml page. To call compare product page generally we use

<?php echo $this->helper('catalog/product_compare')->getListUrl() ?>

Now by using php how can I call the newsletter subscription page?


texts: Home to make a Multi Level Field Dependency in Admin Form Magento 2

texts:
I have 3 Field

type
Display On
Container

the visibility of [Display on , container] depends on value of type field

value of [container] depends on value of [Display on ] on field

I have tried this

<field name="slider_type">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Vendor\ModuleName\Model\Config\Source\ProductType</item>
                <item name="config" xsi:type="array">
                    <item name="component" xsi:type="string">Vendor_ModuleName/js/form/element/options</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Type</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="source" xsi:type="string">modulename</item>
                    <item name="dataScope" xsi:type="string">slider_type</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
        <field name="slider_location">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Vendor\ModuleName\Model\Config\Source\Location</item>
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Display On</item>

                    <item name="formElement" xsi:type="string">select</item>
                    <item name="source" xsi:type="string">modulename</item>
                    <item name="visible" xsi:type="boolean">false</item>
                    <item name="dataScope" xsi:type="string">slider_location</item>
                    <item name="default" xsi:type="string">0</item>
                    <item name="component" xsi:type="string">Vendor_ModuleName/js/form/element/containers</item>
                </item>
            </argument>
        </field>

Here is My Options.js

define([
    'underscore',
    'uiRegistry',
    'Magento_Ui/js/form/element/select',
    'Magento_Ui/js/modal/modal'
], function (_, uiRegistry, select, modal) {
    'use strict';

    return select.extend({

        initialize: function () {
            var value=this._super().initialValue;
            console.log('Selected Value: ' + value);
            var field1 = uiRegistry.get('index = slider_location');
            var field2 = uiRegistry.get('index = slider_postion');
            if (value=='new' || value=='best-seller' || value=='featured' || value=='mostviewed') {
                field1.show();
                field2.show();
            } else {
                field1.hide();
                field2.hide();
            }

            return this._super();
        },
        onUpdate: function (value) {
            console.log('Selected Value: ' + value);

            var field1 = uiRegistry.get('index = slider_postion');
            var field2 = uiRegistry.get('index = slider_location');
            if (value=='new' || value=='best-seller' || value=='featured' || value=='mostviewed') {
                field1.show();
                field2.show();
            } else {
                field1.hide();
                field2.hide();
            }

            return this._super();
        },
    });
});

I am getting an error in options.js

  TypeError: field1 is undefined


texts: Use custom email template in another email template

texts:
i created an email template in Admin > Marketing > E-Mail Templates like this:

I tried to add to my module email template html by using the template subject like this:

{{template config_path="design/email/header_template"}}

<table>
  <tr> <td> Hello </td> </tr>
</table>

{{trans "Footer"}}

my new custom template content wont load, instead it only print plain text {{trans "Footer"}}


texts: How to add custom js file before body tag in magento 2?

texts:
But script moving to inside body tag how to fixes this issue? Anyone
can help me for this

<referenceContainer name="head.additional">
   <block class="Magento\Framework\View\Element\Template" name="custom_js" template="Magento_Theme::html/mycustomjs.phtml" before="-"/>
</referenceContainer>


texts: how to return collection from controller to view page in magento 2?

texts:
I am using the custom module. I have added the search box on the cms page and add search query in the controller. After searching the keyword data collection is generating correctly. But, now I want to send this data collection on the same search page. How can I achieve this?

I am using below code in controller:

<?php
/**
 *
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Allin\ReorderForm\Controller\Index;
use Magento\Framework\Controller\ResultFactory;
    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
//protected $resultPageFactory;

    /**
     * @param \Magento\Framework\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
class Search extends \Magento\Framework\App\Action\Action
{

    public function execute()
    {
        //$this->_view->loadLayout();
        //echo 'testtttttttt'; die;
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        $post = $this->getRequest()->getPost();
        //$post = $this->getRequest()->getPost('name');
        if (!$post) {
            $this->_redirect('*/*/');
            return;
        }

        if(1)
        {
            $query = $post['search'];
            echo 'Query = '.$query;

            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $Collection = $objectManager->create('Allin\Pharmacy\Model\Pharmacy')->getCollection()->addFieldToFilter('pharmacy_name', array('like' => '%'.$query.'%'));
            //echo '<pre>'; print_r($Collection->getData());  die;

            foreach($Collection as $data){
                    echo $data->getPharmacyName();
            }
            die;
            $this->messageManager->addSuccess(
                __('Thanks for contacting us with your comments and questions. We\'ll respond to you very soon.')
            );
        } else {
            $this->messageManager->addError(
                __('Something missing in your details!')
            );
        }

      $resultRedirect->setUrl($this->_redirect->getRefererUrl());
        return $resultRedirect;
    }
/*  public function execute()
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        echo $objectManager->create('\Magento\Framework\Registry')->register('foo', 'bar');

        return $objectManager->create('Magento\Framework\View\Result\PageFactory')->create();
    } */
    /**
     * Get Data Persistor
     *
     * @return DataPersistorInterface
     */
    private function getDataPersistor()
    {
        if ($this->dataPersistor === null) {
            $this->dataPersistor = ObjectManager::getInstance()
                ->get(DataPersistorInterface::class);
        }

        return $this->dataPersistor;
    }
}


texts: How to move existing links and add new custom links in top header?

texts:
I already check many answers regarding the move header.links to header-wrapper its working but the problem is that it also move my custom links to header content.

I am trying to create a new container which has a parent header.links, but
its not working.

here is my default.xml

     <referenceContainer name="header.links">
        <container name="custom-content" as="custom-content" label="Page Custom Content" htmlTag="div" htmlClass="custom-content" />
    </referenceContainer>
    <container  name="custom-content" >
        <block class="Magento\Framework\View\Element\Html\Link" name="contactus.link" after="register-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">Contact Us</argument>
                <argument name="path" xsi:type="string" translate="false">contact-us</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link" name="aboutus.link" after="contactus.link">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">About Us</argument>
                <argument name="path" xsi:type="string" translate="false">about-us</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link" name="customerservice.link" after="customerservice.link">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">Customer Service</argument>
                <argument name="path" xsi:type="string" translate="false">customer-service</argument>
            </arguments>
        </block>
    </container >
    <move element="header.links" destination="header-wrapper" />

First I create new container custom-content then I move existing links like Sign in, Create an account link & Greeting message to header-wrapper and then define my custom link into my custom container, but its not working.

if I remove custom container then move is working fine.


texts: What to change in product list button to allow "View Details" instead of "Add to Cart"?

texts:
I'm looking to use a "View Details" button instead of add to cart because the latter isn't always working with my Full Page Cache extension (it instead just shows you that your cart is empty when you try to add something), so for now, until I find a fix, I would like to use "View Details" as it should work all the time.

What method would I use within the <button onclick=""> so that it links to the item's details?

Here is the current code in my template file:

    <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')">
        <?php echo $this->__('Add to Cart') ?>
    </button>


texts: Successful Logins redirects to Login Page - Magento

texts:
I have scoured the internet but cannot find an answer, and the answers I find are to having Magento locally installed (MAMP/WAMP) etc.

I have installed Magento www.domain.com (1.7.0.2) and also in my developer site www.dev.domain.com. (1.9.0.1)

when I try to login into my admin sites, sometimes I get kicked out automatically. I try to sign in but it loops me back to the login screen. I do not get the red error message 'username/password is wrong'.

I get kicked out from both sites (my www.domain.com and my subdomain www.dev.domain.com)

after clearing my cookies held in my browser (any browser) it allows me to log back in? I can see that the adminhtml cookie is giving me 1 hour expiration. sometimes I get kicked out straight away after logging in?

I can't check Magentocommerce as the website is under maintenance. My domain is hosted on a VPS, installed as Local Server.

please can anyone help?

thanks


texts: How to add Data to Custom table in database using model in magento 2.3.5

texts:
I am created one form for contact and i want to insert form data into custom table in database in magento 2.3.5
so can anyone have idea about it then please send me solution.
<?php
namespace Aspl\Contact\Controller\Ajax;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\View\Result\PageFactory;
use Aspl\Contact\Model\ContactFactory;

class ContDet extends Action
{
    protected $_pageFactory;

    protected $_resultPageFactory;

    protected $_resultJsonFactory;

    protected $contactFactory;

    public function __construct(
        Context $context, ContactFactory $contactFactory, PageFactory $resultPageFactory, JsonFactory $resultJsonFactory)
    {
       $this->contactFactory = $contactFactory;
       $this->_resultPageFactory = $resultPageFactory;
       $this->_resultJsonFactory = $resultJsonFactory;
       return parent::__construct($context);
    }

    public function execute()
    {
        $result = $this->_resultJsonFactory->create();
        $resultPage = $this->_resultPageFactory->create();

        try {

                $data = $this->getRequest()->getParams('data');

                $model = $this->contactFactory->create();

                //save data to variables
                $model->setName($data['name']);
                $model->setContact($data['contact']);
                $model->setAddress($data['address']);
                $model->setComments($data['comments']);

                $model->save();

                $response = [
                    'errors' => false,
                    'message' => __('Please Wait our Service team can contact you as soon as possible.')
                ];

            }
            catch (\Exception $e)
            {
                $response = [
                    'errors' => true,
                    'message' => __('Invalid Contact Details.').$e->getMessage()
                ];
            }
            return $result;
    }
}

Thank you in Advance.


texts: Magento 2 - get final prices include tax and round

texts:
I've custom block phtml in my old store and I need to be converted to Magento 2.

Magento 1.9.x code:

$_finalPriceInclTax = $this->helper('tax')->getPrice($_product, $_product->getFinalPrice(), true);
$unitPrice = Mage::helper('core')->currency(round($_finalPriceInclTax / $_product->getHedNetWeight(), 2),true,false);

How can I get Final Price included Tax in Magento 2 and how can I use Mage::helper('core')->currency(round) in Magento 2?

I try to display the price like this:

$this->helper('Magento\Framework\Pricing\Helper\Data')->currency($finalprice / $HedNetWeight,true,false);

Thank you


texts: Magento : Add product qty box in related product

texts: I have a related product list in product detail page. Default there is not qty box available to edit qty i want to add qty box and also it's qty add to checkout/cart page while add specific qty.


texts: Manage Customer Attributes in Magento 2.2 Backend

texts:
As mentioned in the Magento 2 Dev Docs, there is an admin section to manage customer attributes.

  On the Admin sidebar, tap Stores. Then under Attributes, choose Customer.

I looked for this section in Magento 2.2 but I did not found it. As i saw, the screenshots in the Dev Docs were made with Magento Version 2.0.0.

Is this admin section still available in Magento 2.2, and where can it be found, or is there a new way to manage your customer attribtues?

I would need this to edit an existing customer attribute and add a new one for testing purposes.


texts: Add custom options to magento 2 grouped product

texts:
I want to add custom options to grouped product which will apply to the grouped product directly.
How can I achieve this?


texts: Is the order of declaration very important in Config.xml file?

texts:
Is the order in which we declare various parameter's, settings .. in config.xml file very strict , such as

  adminhtml-layout> tag should always come before adminhtml-menu> tag?

is it that strict or order of declarations can be varied and magento automatically detects it.

which way is the right one?


texts: Magento Adminhtml Controller looking for the wrong URL

texts:
So I'm trying to make an Admin menu for a module I'm developing. The menu itself displays fine but when I click on it I get a 404 page.

This is my code:

Jiri/Servicepunten/etc/config.xml

<modules>
    <Jiri_Servicepunten>
        <version>1.0.0</version>
    </Jiri_Servicepunten>
</modules>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Jiri_Servicepunten after="Mage_Adminhtml">Jiri_Servicepunten
                    </Jiri_Servicepunten>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Jiri/Servicepunten/etc/adminhtml.xml

 <config>
<menu>
    <service translate="title" module="jiri_servicepunten">
        <title>Service</title>
        <sort_order>50</sort_order>
        <children>
            <servicepunten>
                <title>Servicepunten</title>
                <sort_order>1</sort_order>
                <action>adminhtml/Servicepunten</action>
            </servicepunten>
        </children>
    </service>
</menu>

Jiri/Servicepunten/controllers/ServicepuntenController.php

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

}

When I try to debug the controller filename in core/Mage/Core/Controller/Varien/Router/Standard.php it looks in the following place:

 app/code//Jiri/Servicepunten/////////////////////////controllers/ServicepuntenController.php"

I'm not sure where all the slashes are coming from. Its in the local pool btw. Anyone have any ideas?


texts:
how do I enable SOAP on Magento2?

If I access http://example.com/soap?wsdl&services=customerV1 I get

[2015-04-24 05:47:01] main.CRITICAL: exception 'RuntimeException' with message 'Report ID: webapi-5539d8d5c0c57; Message: Requested service is not available: "customerV1"' in /srv/vhosts/magento2/html/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php:194
Stack trace:
#0 /srv/vhosts/magento2/html/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(RuntimeException))
#1 /srv/vhosts/magento2/html/var/generation/Magento/Framework/Webapi/ErrorProcessor/Proxy.php(95): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(RuntimeException))
#2 /srv/vhosts/magento2/html/app/code/Magento/Webapi/Controller/Soap.php(171): Magento\Framework\Webapi\ErrorProcessor\Proxy->maskException(Object(RuntimeException))
#3 /srv/vhosts/magento2/html/app/code/Magento/Webapi/Controller/Soap.php(129): Magento\Webapi\Controller\Soap->_prepareErrorResponse(Object(RuntimeException))
#4 /srv/vhosts/magento2/html/var/generation/Magento/Webapi/Controller/Soap/Interceptor.php(122): Magento\Webapi\Controller\Soap->dispatch(Object(Magento\Framework\App\Request\Http))
#5 /srv/vhosts/magento2/html/lib/internal/Magento/Framework/App/Http.php(115): Magento\Webapi\Controller\Soap\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#6 /srv/vhosts/magento2/html/lib/internal/Magento/Framework/App/Bootstrap.php(245): Magento\Framework\App\Http->launch()
#7 /srv/vhosts/magento2/html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#8 {main} [] []

I'm running 0.74.0-beta5.


texts: Magento 2 Order Confirmation How to Send Two Email

texts:
I am using Magento 2.1.6, I want to send two different email on order confirmation.

Order confirmation email sent successfully.But how i send my custom another email.

Thanks in Advance


texts: How to export product Advance pricing in magento 2

texts:
how to  export product Advance pricing  in Magento 2
Currently, I am using profiler to export product price but I didn't get
Advance pricing so how can I export Advance pricing store wise
in Magento 2
If any programmatically script and any tool then
let me know fast.
Thank you.


texts: PWA create custom origin for custom project

texts:
I having an issue with create custom origin it doesn't seem to be reading .env file from my project folder but I have a .env file and it's all set.
Create Project REF: https://magento.github.io/pwa-studio/pwa-buildpack/reference/buildpack-cli/create-project/
yarn buildpack create-custom-origin package/custom-pwa
$ /Users/juliano/Sites/pwa-sites/pwa-studio/node_modules/.bin/buildpack create-custom-origin package/custom-pwa ⓧ  Missing required environment variables: MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/") CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk") ⓧ  Error: Missing required environment variables: MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/") CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk") ⓧ  Error: Error: Missing required environment variables: MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/") CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
All of the above is specified in inside project package/custom-pwa/.env
any ideas what could be ?


texts: How to change the copyright background-color at footer in Magento2?

texts: I want to change the background-color of footer(copyright) without configuring the less file. Is it possible through the admin panel ?


texts: Uncaught Error: Call to a member function dispatch() on null View\Element\AbstractBlock.php on line 652

texts:
help needed
i am creating a factory in block and get data from model it give result in block but when i return this factory and use this block function in phtml file it give error " Fatal error: Uncaught Error: Call to a member function dispatch() on null in C:\wamp64\www\hum\vendor\magento\framework\View\Element\AbstractBlock.php on line 652 "


texts: Hide Zero Price for configurables in 1.7

texts:
Lets say i have a configurable product. The base price is null. Then when you select a variant from the dropdown menu, the price changes dynamicly in frontend. So. How do i hide the price if the price is $0.00?
I have tried

if($this->getPriceHtml($_product) == 0:
//Do nothing
else:
echo $this->getPriceHtml($_product);
endif;

But this just hide all the price. So if the user changes the price from non variant to
some variant, the price does not show at all.

Any ideas how to solve this? :)


texts: Magento 2 .gitignore template in combination with Deploybot and Git workflow

texts:
I installed Magento 2 using composer locally (on my local Dev environment using MAMP).

I added my custom theme and did all my frontend work on my local Dev site.
I want my code and changes to be tracked by Git and pull it in on my
Staging site (from the Beanstalk remote repo)

I installed Magento 2 using Composer and @Claudiu Creanga advised me in this article to use the service Deploybot to deploy the site to Staging.

I have a few questions regarding this process:

How do I have to setup my .gitignore file? In other words; which
files and folders I have to track and I have to commit and push to
my remote repo?
How do I install my site on the Staging server? Also using Composer?
Because I used Composer to install Magento 2, I can use composer
update to update Magento 2 core. But how do I update my Staging
site? Also using composer update? So if I understand wright I
don't pull in this update changes by Git from my remote repo?
How do I install and update Extensions? Also using Composer? So I
don't add the Extensions via Git and I don't track the Extensions,
isn't it?


texts: Whats the main use of item name="types" in magento 2 checkout xml file?

texts:
In checkout_index_index.xml file,

What's the use of item name="types" in checkout page?

Also item name with form.input is not defined anywhere in checkout module.

<argument name="jsLayout" xsi:type="array">
    <item name="types" xsi:type="array">
        <item name="form.input" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
            <item name="config" xsi:type="array">
                <item name="provider" xsi:type="string">checkoutProvider</item>
                <item name="deps" xsi:type="array">
                    <item name="0" xsi:type="string">checkoutProvider</item>
                </item>
                <item name="template" xsi:type="string">ui/form/field</item>
                <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
            </item>
        </item>
    </item>
</argument>

Can anyone let me know whats the use of above xml code in checkout page?

Thanks.


texts: Bundle product item drop down option value not showing in order

texts: I am using magento 1.7.1 , Currently i am facing an issue with bundle product items. Its a drop down selection of choosing the size and color, Size options with is not showing up in order, For ex : 55 , 40 50 . I want to show the dropdown like 45 , 50 , 55 . Any idea how can fix this ?


texts: Solving languages (multi)store: what if a category/product/page does not exist in the other language?

texts:
we have a multistore with many languages. Now the situation exists where 1 language can have a category that the other does not. So store1/en has  store1/en/blueshoes and store2/fr does not sell blue shoes. The category is disabled (greyed out) in the category config.

So in short: you click the flag in the header and that store changes language. Only to see that the result is a 404.

I think this can be called a small bug in Magento. Or at least a choice should be give how to solve this in the backend. I can think of three options.

don't show the flag / language switcher in this situation
change the link to link to the main page
keep showing 404 (current behavior)

All these solutions can be created, but only if  we can find out that $_lang->getCurrentUrl() cannot find an active CurrentUrl for the current language shop in the foreach statement. So it returns false or we can detect the existance of the URL via another method: does it exist and/or is it activated. In the case that is does not exist or it is not actived: then revert to options 1,2 and 3 above.

Question: how can we find out if a certain $_lang->getCurrentUrl() is not activated/does not exist so we can change the behavior and circumvent the 404.

thanks, Sean

<?php
/**
 * Language switcher template
 *
 * @see Mage_Page_Block_Switch
 */
?>
<?php if(count($this->getStores())>1): ?>

    <?php echo $this->__('Your Language:') ?>
    <select id="select-language" title="<?php echo $this->__('Your Language') ?>" onchange="window.location.href=this.value">
    <?php foreach ($this->getStores() as $_lang): ?>
        <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
        <option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->escapeHtml($_lang->getName()) ?></option>
    <?php endforeach; ?>
    </select>

<?php endif; ?>


texts:
I'm creating a custom brand page in which are listed product with a specific brand.

I've created a static page with a 2 column layout, with a left sidebar in which I'm putting filters and the main column contains the products grid.

This is the code for the content widget

{{widget type="Magento\CatalogWidget\Block\Product\ProductsList"
show_pager="0"
products_count="100"
tagline="bla bla bla."
logo="pub/media/brands/brand.png"
template="MyVendor_MyTheme::product/widget/content/grid.phtml"
conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`brand`,`operator`:`==`,`value`:`3847`^]^]"}}

for which I've overridden the Magento template grid.phtml

In the left sidebar I've put layered navigation

<referenceContainer name="sidebar.main">
             <block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" before="-" template="layer/view.phtml">
                   <block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalog.navigation.state" as="state" />
                   <block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalog.navigation.renderer" as="renderer" template="layer/filter.phtml"/>
            </block>

        </referenceContainer>

for which I'm overriding the view.phtml template.
I'm able to start with a filtered collection in the view.phtml like this

$block->getLayer()->getProductCollection()->addFieldToFilter('brand','3847')

and filters returns the correct item count inside the block.

I've added a:

$block->getProductCollection()->addFieldToFilter('brand','3847')

in the grid.phtml just for debugging and the collection is correct in the grid.phtml template

The  problem is that the filter is not applied to the grid.phtml block.

How do I "connect" the two blocks?


texts:
Trying to apply this patch to a 1.9.2.4 site and getting errors. Have already managed this with other Magento versions, a few errors but nothing I can't fix.

Getting these errors:

patching file app/etc/modules/Mage_All.xml
Hunk #1 FAILED at 275.
Hunk #2 FAILED at 397.
2 out of 2 hunks FAILED -- saving rejects to file app/etc/modules/Mage_All.xml.rej

I've checked this file and it is identical to what the patch is expecting

patching file skin/adminhtml/default/default/media/uploader.swf
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file skin/adminhtml/default/default/media/uploader.swf.rej

patching file skin/adminhtml/default/default/media/uploaderSingle.swf
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file skin/adminhtml/default/default/media/uploaderSingle.swf.rej

This post (Magento Patch SUPEE 8788 - 1.9.2.4 - uploaderSingle.swf) suggesting zipping and unzipping the patch file, but this had no effect for me.

Any ideas?


texts: Magento 2 Migration: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes

texts:
In Map Step some time after below type error showing

  Communication link failure: 1153 Got a packet bigger than
  'max_allowed_packet' bytes

Source Magento : 1.9.3.3
Destination Magento : 2.3.2

How can solve above error

Any help would be appreciated.

Thanks.


texts: extra space in magento 1.9.0.1 home page

texts:
I am a week into magento its being used as a CMS, the issue i have on the home page the slider has a large space on the bottom of the image can advice.

see http://thenet4business.com/magento/index.php/

regards

Storm


texts: Memory Limit Reached When Switching Currency

texts:
I have a strange bug, wonder if anyone can help.

Scenario

have an empty cart
switch to euros
Loads fine
Add a product to cart
Loads fine
Switch back to pounds
Site hangs and then crashes
Site cant be reloaded until all cookies are deleted

Error Message

  [Thu Jun 12 12:11:56.419992 2014] [:error] [pid 2652] [client xxx] PHP
  Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried
  to allocate 7 bytes) in /var/www/lib/Zend/Db/Statement/Pdo.php on line
  290

As you can see my memory limit is 1024m  which is WAY more than enough, so it must be something else :/ just not sure what.

Thoughts?

Installed Modules

AW_All
AW_Kbase
AlanCole_CouponFix
AlanCole_GooglePS
AlanCole_LiveChat
AlanCole_PackingSlip
AlanCole_QuickOrder
AlanCole_QuickbooksIntergration
AlanCole_StoreLocator
Amasty_Oaction
Aschroder_SMTPPro
Cm_RedisSession
CommerceExtensions_Core
CommerceExtensions_Mergecustomers
Ebizmarts_AbandonedCart
Ebizmarts_Autoresponder
Ebizmarts_MageMonkey
Ebizmarts_Mandrill
Ebizmarts_SagePayReporting
Ebizmarts_SagePaySuite
EmjaInteractive_OrderAssign
Ezmage_OscommerceImport
Fishpig_Wordpress
Fishpig_Wordpress_Addon_AddThis
Fishpig_Wordpress_Addon_LightboxGallery
Fishpig_Wordpress_Addon_WordPressSEO
Fishpig_Wordpress_Addon_Yarpp
Fishpig_Wordpress_FPAdmin
Fooman_GoogleAnalyticsPlus
Innoexts_Core
Innoexts_CurrencyPricing
JeroenVermeulen_Solarium
Magemaven_OrderComment
MagenThemes_MTColinusAdmin
MagenThemes_Mtslideshow
Magneto_Debug
Meanbee_Shippingrules
Meanbee_Tinymce5
Phoenix_Moneybookers
PostcodeAnywhere_CapturePlus
Shweta_Ajaxcoupon
Webshopapps_Matrixrate


texts:
I need the state to be a required field in the checkout page so I set it in the Admin Panel

But it is not working. How can I fix this one? I am using Magento 2.1.6


texts: How to get List Layer Filters in magento 1?

texts:
I trying to get list layer filters option in Magento 1 in custom file name is list_layer_options.php. This is my source:

$appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters();
var_dump($appliedFilters);

It's return array(0), so how can get list layer option. Thanks!


texts: Magento 2: Definition of function getOptionsCollection

texts:
I'm trying to extend a function getOption() of Bundle Class(Magento\Bundle\Block\Catalog\Product\View\Type\Bundle.php) in my own Class
using following code

protected $_ProductBundle;

public function __construct(
\Magento\Backend\Block\Template\Context $context,
array $data = [],
\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle $ProductBundle,
)
{
        $this->_ProductBundle = $ProductBundle;
        parent::__construct($context, $data);
    }

and then I declared this getOptions function in the same class

public function getOptions()
    {
        return $this->_ProductBundle->getOptions();
    }

I'm getting following error when I call above function from my phtml file

  Fatal error: Call to undefined method
  Magento\ConfigurableProduct\Model\Product\Type\Configurable\Interceptor::getOptionsCollection()
  in
  C:\xampp\htdocs\Magento21\app\code\Vendor_Name\Catalog\Block\Product\ProductBundleNew.php
  on line 82

Above function getOptionsCollection() is coming from getOptions function from Bundle.php

public function getOptions()
    {
        if (!$this->options) {
            $product = $this->getProduct();
            $typeInstance = $product->getTypeInstance();
            $typeInstance->setStoreFilter($product->getStoreId(), $product);

            $optionCollection = $typeInstance->getOptionsCollection($product);

            $selectionCollection = $typeInstance->getSelectionsCollection(
                $typeInstance->getOptionsIds($product),
                $product
            );

            $this->options = $optionCollection->appendSelections(
                $selectionCollection,
                false,
                $this->catalogProduct->getSkipSaleableCheck()
            );
        }

        return $this->options;
    }

I'm not able to get the definition of getOptionsCollection.
Is this function declared somewhere else? do I have to extend some other class to call this function?


texts: Imported attributes show in a different admin section than magento attributes

texts:
I've imported my products from WordPress to Magento. There were a few attributes that imported along with my products, and these attributes appear above (and outside of) the "Attributes" panel on the "edit product" page:

http://i.imgur.com/6OwBtKH.png
http://i.imgur.com/RqW63oV.png

Is there any way to get all of these attributes in the same section, so editing them is more convenient? Thanks!


texts: Missing Import / Export Options under System->Data Transfer (Magento CE 2.4.1 + Claue Theme)

texts:
When logged in as an administrative user (with all resources including data transfer allocated), under the System->Data Transfer menu, there are no import /export options available. The entire Data Transfer menu is blank. See below

I believe this may be caused by the Claue Theme that was installed. I am also contacting the vendor to resolve this, but they typically take 3-5 days and am working on a tight timeline.
How can the import/export options be re-enabled? Alternatively, how would one go about trying to troubleshoot the issue?
This is running on:

Ubuntu 18.04, Apache 2.4.29, Mysql Ver 14.14-5.7.32, PHP 7.4.12

Am new to the community and Magento, any assistance or pointers would be much appreciated.
Thank you very much.


texts: Getting error in Magento Admin panel "Whoops, our bad..."

texts: Please help me to find out the issue of "Whoops, our bad...". I have tried other solution but not getting success.


texts: Magento 1: recommended way of preserving SEO during non-Magento migration

texts:
So here's the idea, one of our clients has got a Prestashop website and would like to migrate to Magento.

The migration is no big deal as we have made several migrations before.

However, I'm wondering what would be the best plan of attack to preserve the SEO from Prestashop after migration ?


texts: Magento 2: How to override Magento\Catalog\Block\Product\View constructor to inject \Magento\Eav\Model\Entity\Attribute\SetFactory

texts:
I am attempting to override the __construct method in the Magento\Catalog\block\Product\View block so that I can access the Magento\Eav\Model\Entity\Attribute\SetFactory to get the AttributeSetName of a product in the addtocart.phtml. However, I keep running into a 404 Error.

I created a module and extended the Magento\Catalog\Block\Product\View class.

namespace MyVendor\MyModule\Block\Product;

use Magento\Catalog\Block\Product\View as BaseView;

class View extends BaseView {

    protected $_attributeSetFactory;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Framework\Url\EncoderInterface $urlEncoder,
        \Magento\Framework\Json\EncoderInterface $jsonEncoder,
        \Magento\Framework\Stdlib\StringUtils $string,
        \Magento\Catalog\Helper\Product $productHelper,
        \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig,
        \Magento\Framework\Locale\FormatInterface $localeFormat,
        \Magento\Customer\Model\Session $customerSession,
        ProductRepositoryInterface $productRepository,
        \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
        \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory,
        array $data = []
    ) {
        $this->_attributeSetFactory = $attributeSetFactory;
        parent::__construct(
            $context,
            $urlEncoder,
            $jsonEncoder,
            $string,
            $productHelper,
            $productTypeConfig,
            $localeFormat,
            $customerSession,
            $productRepository,
            $priceCurrency,
            $data
        );
    }

/**
 * Add meta information from product to head block
 *
 * @return \Magento\Catalog\Block\Product\View
 */
protected function _prepareLayout()
{
    parent::_prepareLayout();
}

}

In the Magento\view\frontend\templates\product\view\addtocart.phtml template I wasn't sure if I had to change the line /** @var $block \Magento\Catalog\Block\Product\View */ to reference my block instead of the core block either.

Snippet from MyVendor\MyModule\view\frontend\templates\product\view\addtocart.phtml:

...
/** @var $block \Magento\Catalog\Block\Product\View */
?>
<?php $_product = $block->getProduct(); ?>
<?php echo $block->getAttributeSetName(); ?>
<?php $buttonTitle = __('Add to Cart'); ?>
...

After reading documentation I do not think I am injecting the factory correctly in the construct because before getting the 404 error I was having issues with the order the parameters are passed in the __construct. However, after I cleared the cache I get the 404 error. Any help and direction would greatly be appreciated.

This is my di.xml file:

<?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\Catalog\Block\Product\View" type="MyVendor\MyModule\Block\Product\View" />
</config>


texts: Magento 2 /rest/V1/categories/ get Include in menu and Url key

texts:
How to add the below attributes in "/V1/categories/" api response

include_in_menu

url_key

thanks


texts: Magento 2 PWA Venia - how to set 404 page

texts:
I'm using Venia from PWA Studio and I want to create redirect to my 404 page when someone use wrong link for example "http://venia.loc/wrong-route".
Page on dev environment when running "watch:venia"

Page when running "stage:venia", simple "Not found"

Is there any way to change it?


texts: Zoom option on my product pages - magento

texts:
I have zoom option on my product page, but when its clicked it hangs the website - i checked on other PCs and its the same scenario

Also I am also not getting the 2 tiny pics which use to come earlier below the product image.  The "Exclude" in the db is '0' for all products.

product page example :-
http://justfrompound.com/root-catalog/default-category/wood-thermometer.html