texts: problem switching to client side compilation

texts:
I'm trying to switch to client-side compilation in Configuration->Advanced->Developer->Frontend Development Workflow however the option is disabled and I cant' select it. It says

not available in production mode

however I'm in developer mode from what I can see.

in app/etc/env.php I have

'MAGE_MODE' => 'developer',

in php bin/magento deploy:mode:show the result is

Current application mode: developer.

in .htaccess there is the line

SetEnv MAGE_MODE developer

I've cleaned generated/code directory
I've ran php bin/magento cache:clean
I've set ownership/permissions to all folders and files

Any ideas what else I can try?

After further troubleshooting I can see in
vendor/magento/module-developer/Block/Adminhtml/System/Config/WorkflowType.php

if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION)

returns false so I'm definitely NOT in production mode and parent::render() is called.

Afterwards in
vendor/magento/module-config/Block/System/Config/Form/Field.php

I can see $isCheckboxRequired is true and $element->getInherit() returns 1 so the field is disabled.

public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
    $isCheckboxRequired = $this->_isInheritCheckboxRequired($element);

    // Disable element if value is inherited from other scope. Flag has to be set before the value is rendered.
    if ($element->getInherit() == 1 && $isCheckboxRequired) {
        $element->setDisabled(true);
}

However I can't see from the field definition in system.xml why this field is impossible to edit for me.


texts:
I'm trying to display a couple of product attributes on the wishlist page.
However, when I call $product->getData('attribute_code') it returns NULL.

Here is the code I currently have in place:

  app/code/vendor/extension/etc/catalog_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <!-- Wishlist Page -->
    <group name="wishlist_item">
        <attribute name="binding"/>
        <attribute name="used"/>
        <attribute name="format"/>
    </group>
</config>

  app/design/frontend/vendor/Theme/Magento_Wishlist/templates/item/list.phtml

$test = $product->getData('binding');
var_dump($test);    // displays NULL

I looked under
Store -> Attributes -> Product -> binding -> Storefront Properties
and "Used in Product Listing" is set to "Yes"

I also toggled "Visible on Catalog Pages on Storefront" with no change.

What am I missing?


texts:
O.P.
Hi all,

I need to pull in the secure URL for the product in the Google PLA XML file

The current code is:

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>Data feed Title</title>
<link>http://www.website.com</link>
<description>Data feed description.</description>
<item>
<!-- Basic Product Information -->
<g:id>{sku}</g:id>
<title>{name,[substr],[70],[.]}</title>

<description>{description,[cleaner],[html_entity_decode],[strip_tags],[default],[{name}],[substr],[500],[.]}</description>

<g:google_product_category>1239</g:google_product_category>

{G:PRODUCT_TYPE,[10]}
<link>{url parent}</link>
{G:IMAGE_LINK}
<g:condition>new</g:condition>

<!-- Availability & Price -->
<g:availability>{is_in_stock?[in stock]:[out of stock]:[available for order]}</g:availability>
<g:price>{normal_price,[AUD],[0]}AUD</g:price>
{G:SALE_PRICE,[AUD],[0]}

<!-- Unique Product Identifiers-->

<? if("{brand}"=="") return '<g:brand>Discount Toy Co</g:brand>';
else return "<g:brand>{brand}</g:brand>" ; ?>

<g:gtin>{barcode}</g:gtin>
<g:mpn>{sku}</g:mpn>
<g:identifier_exists>TRUE</g:identifier_exists>

<!-- Apparel Products -->

<? if("{gender}"=="Girls") return '<g:gender>female</g:gender>';
if("{gender}"=="Boys") return '<g:gender>male</g:gender>';
else return '<g:gender>unisex</g:gender>' ;?>

<g:age_group>{age_group}</g:age_group>
<g:color>{color}</g:color>
<g:size>{size}</g:size>

<!-- Product Variants -->
{G:ITEM_GROUP_ID}
<g:material>{material}</g:material>
<g:pattern>{pattern}</g:pattern>

<!-- Shipping -->
<g:shipping_weight>{weight,[float],[2]}kg</g:shipping_weight>

<!-- AdWords attributes -->
<g:adwords_grouping>{adwords_grouping}</g:adwords_grouping>
<g:adwords_labels>{adwords_labels}</g:adwords_labels>
</item>
</channel>
</rss>

The {url parent} is INSECURE however the {G:IMAGE_LINK} gets pulled in as a secure image.

Anyone able to advise the shortcode for the secure URL?

Thanks,


texts: What class do I override (when utilizing SMTPPro) in order to conditionally log but not send emails to a list of recipients?

texts:
Utilizing Magento CE 1.9.x and Aschroder's SMTPPro:

I was wondering if anybody might be able to give me a recommendation on the best method for trying to implement an email blacklist (ie if any of an array's substrings match, nix the email to a log, but send nothing) utilizing Aschroder's SMTPPro for transactional emails.

I've already experimented a bit with the event/observer model, but after having dug through the data structures that I've been able to get my hands on, I'm not sure that this is the way to do anything more than tie in new functionality, as opposed to aborting existing functionality.

Since then I've progressed on to trying to override some of the SMTPPro functionality, to check for the blacklisted substrings in the data/objects available, such as in the following code (added to app/code/local/Aschroder/SMTPPro/Model/Email.php):

class Aschroder_SMTPPro_Model_Email extends Mage_Core_Model_Email {

    //property addition for blacklist implementation by dgetsman
    private $blacklist = array('damo.gets');
    private $ddebug = true;

     public function send() {

        try {
            $dlog = fopen("/tmp/d4m0log.log", "a");
            fwrite($dlog, "Logging successfully now (variable issue)\n");
            fclose($dlog);
        } catch (e) {}  //yeah I know best error handling in the world

        $_helper = Mage::helper('smtppro');

        // If it's not enabled, just return the parent result.
        if (!$_helper->isEnabled()) {
            return parent::send();
        }

        if (Mage::getStoreConfigFlag('system/smtp/disable')) {
            return $this;
        }

        //begin additions by dgetsman to implement email blacklist
        $to_whom = $this->getToEmail();
        foreach ($this->blacklist as $blist_entry) {
            if (strpos($blist_entry, $to_whom) !== false) {
                if ($this->ddebug) {
                    try {
                        $dlog = fopen("/tmp/d4m0log.log", "a");
                        fwrite($dlog, "Blocked email to " . $to_whom . "\n");
                        fclose($dlog);
                    } catch (e) {}
                }

                return $this;
            }
        }*/
        //end additions by dgetsman to implement email blacklist

I'm not really getting anything, including my debugging output out of this code right now when an order successfully goes through.  The standard canned emails sure are still going through, though.

If anybody can point me in the least time intensive methods for handling a question like this, or pointers in the right direction, even just a few guideposts when I'm digging further with my google-fu, anything would be greatly appreciated.

Also, am I going about overriding objects entirely the wrong way for the Magento model here?  If there's some more lower level tutorials that I should be looking at I'm grateful for references there, as well.

Thanks in advance!

-Damon


texts:
I'm trying to upgrade from 1.6.2.0 to 1.9.3.4, and got this error:

Error in file: "/www/clonsite/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php" - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main.base_tax_refunded' in 'field list', query was: UPDATE `sales_flat_order_item` AS `main`
 INNER JOIN (SELECT SUM(citem.row_total) AS `amount_refunded`, SUM(citem.base_row_total) AS `base_amount_refunded`, SUM(citem.base_tax_amount) AS `base_tax_refunded`, SUM(citem.discount_amount) AS `discount_refunded`, SUM(citem.base_discount_amount) AS `base_discount_refunded`, `oitem`.`item_id` FROM `sales_flat_creditmemo_item` AS `citem`
 LEFT JOIN `sales_flat_creditmemo` AS `c` ON c.entity_id = citem.parent_id
 LEFT JOIN `sales_flat_order` AS `o` ON o.entity_id = c.order_id
 LEFT JOIN `sales_flat_order_item` AS `oitem` ON oitem.order_id = o.entity_id AND oitem.product_id=citem.product_id GROUP BY `oitem`.`item_id`) AS `selected`
SET `main`.`amount_refunded` = `selected`.`amount_refunded`, `main`.`base_amount_refunded` = `selected`.`base_amount_refunded`, `main`.`base_tax_refunded` = `selected`.`base_tax_refunded`, `main`.`discount_refunded` = `selected`.`discount_refunded`, `main`.`base_discount_refunded` = `selected`.`base_discount_refunded`
WHERE (main.item_id = selected.item_id)

I don't understand the meaning. Should I create some table to leave this error behind? Whch one and how?

Thanks for your help,


texts: Magento1.9 Compilation Not enabling in Admin panel

texts:
I am new to magento platform. Unfortunately i had executed the Run complier in enable status mode so my customized codes are removed from include folder.Although and i recovered the customize files from my backups but the complier status is always "disable". I have tried to enable "Compilation" in Magento admin panel. When i do so, the site goes blank and to fix this i commented the line below in the config file in "include" folder .

define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');

then the admin panel works fine but still complier status is in disabled mode. so i have commented the below code in index.php file (root folder)

$compilerConfig = 'includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

and then I click enable button then admin is works fine and it shows "Compiler include path is enabled" meassage, But magento "Compiler Status" shows "Disable" and button shows "Enable" option in top right.

How to fix this issue in admin panel? Please suggest me to solve this problem?

if there is any tables to change the status ? if possible please tell me the tables with update query.

Thanks


texts: Magento 1.9 sendTransactional() doesn't include CSS from email template

texts:
I'm using sendTransactional() to send emails programmatically. All working fine besides the following line in the email template is not included

  {{inlinecss file="email-inline.css"}}

Any fixes?


texts:
I am implementing gtm and I want to added data layer when user click on product from catalog, search result or related product. Data layer will be like this

  {   "data": {
      "action": "category",
      "product": {
        "sku": "product sku",
        "name": "product name"
      }   } }

Is there any way how can I catch product click event?


texts: RAW Query on sales_order_item seems not working

texts:
I'm trying to update a sales_order_item data without success.
No exception or error is returned with method A):

$data = array('order_item_custom_field'=> $product->getCustomFieldData());
$model = Mage::getModel('sales/order_item')->load($itemId)->addData($data);
try {
    $model->setItemId($itemId)->save();
    Mage::Log("Data updated successfully.", null, "system.log");
} catch (Exception $e){
    Mage::Log("Error:". $e->getMessage(), null, "system.log");
}

Method B) give nothing better (and also any error):

$writeDb = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "UPDATE sales_flat_order_item SET order_item_custom_field = '". $product->getCustomFieldData() ."' WHERE item_id = ". $item->getItemId();
$writeDb->query($sql);

Note: order_item_custom_field exists and was created by module installer script.

Is someone know if there is any limitation with direct query on Magento?

Edit: I tried a RAW update statement on a custom db table and it worked as expected.

The problem is probably the sales_flat_order_item itself ?
But why it is working when I execute the query directly on MySQL Workbench?


texts:
I have a page with promotions based on set special price from/to date attribute and it shos fine. I have created a new attribute called flash that is a yes/no value. I want to order the previous collection so I show first the ones that have such attribute as a Yes. This is my code and it doesn't sort, the sql query doesn't have a order by clause. It doesn't work replacing setOrder with addAttributeToSort either.

    $collection = Mage::getResourceModel('catalog/product_collection');
    Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
    Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);

    $collection = $this->_addProductAttributesAndPrices($collection)
        ->addStoreFilter()
        ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
        ->addAttributeToFilter('special_to_date', array('or'=> array(
            0 => array('date' => true, 'from' => $todayDate),
            1 => array('is' => new Zend_Db_Expr('null')))
        ), 'left')
        ->setOrder('flash', 'ASC')
        ->setPageSize($this->getProductsCount())
        ->setCurPage(1)

    ;


texts:
I am working on category collection, i find this link. Here

$helper = Mage::helper('catalog/category');

// sorted by name, fetched as collection
$categoriesCollection = $helper->getStoreCategories('name', true, false);

// sorted by name, fetched as array
$categoriesArray = $helper->getStoreCategories('name', false, false);

this lines of code are written but where store id is passed so that all category collection fetch.


texts: Magento 2.3.X country dropdown issue in backend while customer address edit

texts:
I have selected Allow Countries as Saudi and one another as you can see in below screenshot
https://prnt.sc/qjyde9

the issue is that while edit customer record it's showing the different countries as selected from the dropdown in admin general settings.you can check the selected country list in above screenshot.
here is showing a different countries.
https://prnt.sc/qjyg3f


texts: Magento 2 Minicart - Display line item subtotal rather than unit price

texts:
In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

The item object contains item data like below:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    ↵            ↵            $45.00        ↵↵        ↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

  // returns a NaN

  // returns the correct price but without the currency symbol


texts:
<acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <Brain_Vire>
                        <title>Vire Module</title>
                        <sort_order>10</sort_order>
                    </Brain_Vire>
                </children>
            </admin>
        </resources>
</acl>


texts: How can I create admin user programmatically in 1.9.3.1 without current admin password

texts:
I am creating a seller management and I want to login seller to admin panel by assigning them a seller role, role is not a problem, But when I am creating user then user created in admin but I cannot login in it because it is generating random password below is my code:

 $model = Mage::getModel('admin/user');

            $model->setUserId($this->getRequest()->getParam('id'))
                    ->setData($data);
           // print_r($model->getNewPassword());
            if ($model->hasNewPassword() && $model->getNewPassword() === '') {
                $model->unsNewPassword();
            }
            if ($model->hasPasswordConfirmation() && $model->getPasswordConfirmation() === '') {
                $model->unsPasswordConfirmation();
            }

            $result = $model->validate();

            // print_r($result); die();

            if (is_array($result)) {
                Mage::getSingleton('adminhtml/session')->setUserData($data);
                foreach ($result as $message) {
                    Mage::getSingleton('adminhtml/session')->addError($message);
                }
                $this->_redirect('*/*/edit', array('_current' => true));
                return $this;
            }

            $model->setCurrentPassword('admin@123');
            $model->save();

            $role_id = Mage::helper('marketplace')->getConfig('general', 'vendor_role');

            $model->setRoleIds(array($role_id))
                    ->setRoleUserId($model->getUserId())
                    ->saveRelations();

                    // print_R($model->getData()); exit();
            $model->save();


texts:
Call to undefined method
  Mage_Customer_Helper_Data::getIsRequireAdminUserToChangeUserPassword()
  in
  /home/vithauix/public_html/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php on line


texts:
I want to use below script to create a set of categories. The script works fine but I have an issue and I am wondering if their is an option to set the ID for a new category?

Problem is that I am not able to add a sub category for a category that is not in the database yet. I do not know the ID of that category yet because it's in the same import as the new sub category.. Hope this makes sense

    setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
        $count = 0;

    $file = fopen('./var/import/import_cat.csv', 'r');
    while (($line = fgetcsv($file)) !== FALSE) { $count++;
      //$line is an array of the csv elements

      if (!empty($line[0]) && !empty($line[1])) {

          $data['general']['path'] = $line[0];
          $data['general']['name'] = $line[1];
          $data['general']['meta_title'] = "";
          $data['general']['meta_description'] = $line[5];
          $data['general']['is_active'] = $line[2];
          $data['general']['url_key'] = "";
          $data['general']['display_mode'] = "PRODUCTS";
          $data['general']['is_anchor'] = 0;
          $data['general']['navigation_description'] = $line[3];
          $data['general']['is_primary_category'] = $line[4];

          $data['category']['parent'] = $line[0]; // 3 top level
          $storeId = 0;

          createCategory($data,$storeId);
          sleep(0.5);
          unset($data);
        }

    }

     function createCategory($data,$storeId) {

    echo "Starting {$data['general']['name']} [{$data['category']['parent']}] ...";

      $category = Mage::getModel('catalog/category');
      $category->setStoreId($storeId);

      # Fix must be applied to run script
      #http://www.magentocommerce.com/boards/appserv/main.php/viewreply/157328/

          if (is_array($data)) {
              $category->addData($data['general']);

              if (!$category->getId()) {

                  $parentId = $data['category']['parent'];
                  if (!$parentId) {
                      if ($storeId) {
                          $parentId = Mage::app()->getStore($storeId)->getRootCategoryId();
                      }
                      else {
                          $parentId = Mage_Catalog_Model_Category::TREE_ROOT_ID;
                      }
                  }
                  $parentCategory = Mage::getModel('catalog/category')->load($parentId);
                  $category->setPath($parentCategory->getPath());

              }

                    /**
                     * Check "Use Default Value" checkboxes values
                     */
                    if ($useDefaults = $data['use_default']) {
                        foreach ($useDefaults as $attributeCode) {
                            $category->setData($attributeCode, null);
                        }
                    }

              $category->setAttributeSetId($category->getDefaultAttributeSetId());

              if (isset($data['category_products']) &&
                  !$category->getProductsReadonly()) {
                  $products = array();
                  parse_str($data['category_products'], $products);
                  $category->setPostedProducts($products);
              }

              try {
                  $category->save();
                  echo "Suceeded  ";
              }
              catch (Exception $e){
                    echo "Failed ";

              }
          }

  }


texts: No alive nodes found in your cluster (How to configure elaticsearch with magento2.4.1)

texts:
I have installed the magento2.4.1 using CLI, also installed the elastic search (installed elastic search before installing Magento). Now, I am trying to test the connection available in Magento admin panel --> STORES --> Configuration --> CATALOG --> Catalog --> Catalog Search but am getting Connection failed! Test again?. How to resolve this?
I have an active connection with the elastic search port 9200, if I hit localhost:9200 I am getting a successful response.


texts: custom js not showing on frontend until the commands are run magento 2

texts:
I am working on a magento 2 store. I have created a custom js file. It is inside
app/design/frontend/Napespace/Theme/web/js/custom.js

Now whenever I make any changes to my custom.js file, the change does not reflect on frontend until I run the following commands
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

I have checked my magento installation is in developer mode. Is there a way I do not have to run above commands every time, I make some changes to my custom js file as this makes the development process too slow.
I know I can write my custom js code in google console for testing but how to do it in magento so that I do not need to run these commands for every small change in js.


texts: How to show Label "In Stock" or "Out Of stock" in New Products Homepage

texts:
i want to show Availability label "In Stock" or "Out Of stock" in my homepage product display.
do you know how to do this? thankyou


texts: Back End Not working - After tried install 3rd party Extension

texts:
Tried to install payment charge extension, i get error on installation process, and back end is not working.

Error like.

  Fatal error: Class 'Zend_Locale_Data' not found in
  /home/abc/public_html/app/code/core/Mage/Core/Model/Locale.php on
  line 171

How can i solve this error?


texts: Group and apply 'LIKE' filters to product collection (x AND y AND ....) OR (z AND a ...)

texts:
How to filter product collection as follows

WHERE (`att1` LIKE '%val1%' AND `att1` LIKE '%val2%')
OR (`att2` LIKE '%val1%' AND `att2` LIKE '%val2%')

the number of 'LIKE' statements inside groups and 'AND' groups is unspecified but always >0


texts: Magento 2: how to add a custom block in cart summary just after subtotal

texts:
how to add a custom block in cart summary just after subtotal in Magento 2 ?

I have followed many links, but none helped me.

Any help would be appreciated.


texts: What is the difference between base_grand_total and base_total_invoiced?

texts: The MySql table sales_order contains base_total_invoiced and base_grand_total, what is the (technical and semantic) difference between these two values?


texts: Magento 2 - Unset Special Price programmatically

texts:
I have an import script which imports configs and the variants.

There is set the special price if some is set in my import XML document.
If no special price is set, i try to remove the special price. - But it do not
work! - The special price is already set, after save!

if ($oProductGroupVariantProductItem->getSpecialpriceBrutto() > 0) {
    $oSimpleProduct->setSpecialPrice($oProductGroupVariantProductItem->getSpecialpriceBrutto());
} else {
    $oSimpleProduct->setSpecialPrice('');
}

what i am doing wrong?

Thanks
Andre


texts:
How do you update Magento2 version without any downtime of the website?

If updating from the command line, at point of di:compile, the website is down during this period.

If updating from Web Setup Component Manager, there is obviously downtime while store is put in maintenance mode.

Question is simple, is there a way to have no down time of the website when updating Magento2 version?

Same question I guess applied for any 3rd party extensions updated from Web Setup Component Manager or command line.


texts: magento1.9 add attribute with customer for block customer for order

texts:
i want to add a attribute in customer  for block customer for order pls help me below given files and how to add it  in configuration customer tab
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Scommerce_Customer>
            <version>0.0.1</version>
        </Scommerce_Customer>
    </modules>
    <global>
        <models>
            <scommercecustomer>
                <class>Scommerce_Customer_Model</class>
            </scommercecustomer>
        </models>
        <resources>
            <scommercecustomer_setup>
                <setup>
                    <module>Scommerce_Customer</module>
                    <class>Scommerce_Customer_Model_Entity_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </scommercecustomer_setup>
        </resources>
    </global>
</config>

setup.php
<?php
class Scommerce_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup
{
}

mysql4-install.0.0.1.php
<?php
/**
 * Creating custom attributes
 */
/* @var $installer Scommerce_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
$installer->addAttribute('customer', 'new_field_name', array(
        'user_defined'    => 1,
    'label'       => 'New Field Label Name',
    'type'        => 'int',
    'input'       => 'text',
    'visible'     => false,
    'required'    => false,
    ));
$installer->endSetup();


texts: How can we migrate magento 1 EE to magento 2 CE

texts:
I have a site in EE and want to migrate to magento CE 2.3.0 from magento 1.14.1.0

Did anyone has already migrated or had some plan how can we migrate it without any issue with current data?


texts:
Im using Magento ver. 1.9.2.4 CE

I have few different Catalog Price Rules that are applied across customer groups which give 20%, 30%, etc off of products.
The problem I'm having is that the rules, even though they are still in place, seem to 'switch off' within a day or so of having them applied.

As an example, when working correctly the website shows the discount price and 30% off label. Everything is fine through the checkout process.

When things go 'wrong' after an unknown period of time (usually within 24 hours), the discounted price is shown, but the 30% off label disappears and when added to the cart, the product is listed at it's full price.

To correct this, I have to go into Promotions > Catalog Price Rules and click 'Apply Rules', which is obviously not great for me having to do this each day. Has anyone come across, or have a solution to my problem please?

Thanks


texts: Magento 2 How to move shipping methods to a new checkout step between shipping and payment steps

texts:
I want to add a new checkout step between shipping and payment steps and move shipping methods displaying under shipping address form to that new step.

How can I do that? Is it possible or not?


texts:
Magento beginner here, using 1.9.2.4 and Ultimo theme

I have 2 attributes, color and size and would like to display them as swatches, not dropdowns on product pages.

I've configured attributes to appear as swatches on product category and product individual page, but they only appear on category and as dropdown on the product individual page, here is the configuration of the attributes and settings on the back-end:
http://imgur.com/a/YbF7C

Contacted the theme dev and he said swatches are a core functionality of Magento.

Appreciate the help!


texts:
class Productinfo extends \Magento\Framework\View\Element\Template
 {

 protected $checkoutSession;

 protected $quoteFactory;

 protected $collection;
/**
 * Constructor
 *
 * @param \Magento\Framework\View\Element\Template\Context  $context
 * @param array $data
 * @param \Magento\Checkout\Model\SessionFactory $checkoutSession
 */
public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Checkout\Model\SessionFactory $checkoutSession,
    \Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory $collection,
    array $data = []
) {
    $this->checkoutSession = $checkoutSession;
    $this->quoteFactory = $quoteFactory;
    $this->collection = $collection;
    parent::__construct($context, $data);
}

/*
* Get Quote Proudcts
* @return array()
*/

public function getProducts() {
 $quoteId = $this->checkoutSession->create()->getQuoteId();
 $collection  = $this->collection->create();
 $collection->addFieldToFilter('quote_id',$quoteId);
 print_r($collection);die;

}

}

Colleciton is empty . If i use object manager it returns the data.
Please let me know where the mistake is


texts: Why my "Add to cart" button is not working in product page?

texts: Add to cart button not working in my product page. But my test server is working fine, I copied and pasted the code as it is but, onclick event hasn't fire...


texts: How to Customize Order Details Page for Customers

texts:
I'm trying to customize the order detail page that the customer see in his/her account.

What I did is that I copied:

vendor/magento/module-sales/view/frontend/templates/order/view.phtml

Into:

app/design/frontend/CompanyName/ThemeName/Magento_Sales/view/frontend/templates/order/view.phtml

And added some test modifications in there but nothing showed up on the website and it continues to use the original view.phtml

I tried clearing all cache and deploying static content with no luck.

When I enable Template Path Hints for Storefront in the admin and access the order details page, it's still showing that it's using the original view.phtml and not the customized one

Can you please help me with this problem?


texts: override coupon management and guestcoupon management core vendor files magento 2

texts:
I want to override Couponmanagement.php of

Magento\quote\Model\CouponManagement and guestcouponmanagemet.php of

Magento\quote\Model\GuestCart\GuestCouponManagement

but my plugins are not working.PLease help me with di.xml files and what are the other files I need to create.


texts: How how BANK TRANSFER payment method to specific customer?

texts: How can show BANK TRANSFER payments method to specific customer(s), I added customer attribute to the payment method. then if BANK TRANSFER is yes I want to display it to customer. so how can I do it?


texts: I am new to magento, and I need to display the product attributes on product list in the quickview popup of every product. please help,ASAP!


texts:
I have a bit of a strange setup (I think)(I'm fairly new to Magento and webservers). I have Magento installed on a webserver in-house and I want to access it from the LAN IP address rather than having to use the domain name and have the traffic go out to the internet then come back. When I put in the IP it redirects me to the domain name.

(edit) Sorry I wasn't clear - I still need to use the domain name to access the site from outside the network, and when I change the base URL to the IP address I can't get to the site from outside the LAN.

Changing the hosts file does work though...completely slipped my mind.


texts: How to get the block ID and block title when is rendering

texts:
I'd like to add the block ID and the block name among the classes, so I found the file which has the HTML structure.

vendor/magento/module-cms/view/frontend/templates/widget/static_block/default.phtml

Considering I've the $block object there, how can I get the ID and the title/name of the block?


texts: Magento 2.2 - Products showing out of stock

texts:
I'm having an issue where only a handful of products are showing out of stock even though they have inventory and are set to in stock.

One thing I've noticed is that  the products will go to in-stock if I set the quantity to over 23. There is no Out-of-Stock threshold set and other products under 23 quantity are working.

I've compared this product to another product that is not having stock issues and there's no major differences.

I tried wiping all the categories, changing the weights, anything that could for some reason be throwing this off.

The site has been heavily modified, not by myself, is there anything in some of the template files that could be causing this. Any suggestions where to look or what else to do?

I've re-indexed the data, flushed the cache.


texts: Installing an extension in Magento 2 without having to run "setup:upgrade"

texts:
I need to install an extension (Mailchimp for Magento 2) on a website, but need to do it in a way that I won't need to run

bin/magento setup:upgrade.

Basically, the site was built by a developer long gone and has tons of problems, now running that upgrade command will require me to recompile with the command

bin/magento setup:di:compile

which sometimes runs successfully and sometimes not, but always leaves the site in a broken state.

I have tried doing it via composer and the extension was added successfully, then the site broke after upgrading/compiling. I have not tried installing via the component manager because it requires the same upgrade command. Thanks!


texts: Not getting image url from bestseller code

texts:
I wrote some code for best-seller product in magento  but

I m not getting product image url ....

I need small image  for the gallery..

I m  developing bestseller slider .....the whole thing is good

but only i m not getting image url...

my code

$current_category = Mage::registry('current_category');
        $is_category_filter = Mage::getStoreConfig('productslider/product_setting/category_filter');
        $collection = Mage::getResourceModel('reports/product_collection')
                            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
                            ->addOrderedQty()
                            ->addMinimalPrice()
                            ->addTaxPercents()
                            ->addStoreFilter();
        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
        if($current_category && $is_category_filter == '1'){
            $current_category_id = Mage::registry('current_category')->getId();
            $currentCategory = Mage::getModel('catalog/category')->load($current_category_id);
            $collection->addCategoryFilter($currentCategory);
        }
        $collection->setPageSize(30);

        $this->setProductCollection($collection);

         return $collection;


texts: Magento 2.2.2: Discount code not showing in invoice

texts:
I have a store running on Magento 2.2.2 which has various cart price rules configured. Including many with coupon codes attached to them. These codes work fine when adding them to an order (both frontend and backend).

Unfortunately however, they do not seem to appear on invoices. For example an order with the following totals:

Subtotal €27.90
Discount (coupon_code) -€5.58
Grand Total €22.32

Will get the following totals when we create an invoice through the Magento backend

Subtotal €27.90
Grand Total €22.32

As you can see, the coupon code just "disappears" but the discount is still applied in the grand total. According to this issue on Github this was supposed to be fixed in 2.2.2. Am I missing something?

The store was upgraded from an earlier version of Magento and all static files have been refreshed since the update.


texts: Magento 2: Error After Installing Sample Data using Composer

texts:
Im using Magento 2.1.8 and I already installed the sample data using composer but after running this commands setup:upgrade, setup:di:compile, indexer:reindex, cache:clean, cache:flush and changing the permission I have this error from the CustomerSample data

1 exception(s):
Exception #0 (UnexpectedValueException): Setup version for module 'Magento_CustomerSampleData' is not specified

Exception #0 (UnexpectedValueException): Setup version for module 'Magento_CustomerSampleData' is not specified
#0 /var/www/devsvr1/vendor/magento/framework/Module/DbVersionInfo.php(56): Magento\Framework\Module\DbVersionInfo->isModuleVersionEqual('Magento_Custome...', '2.0.0')
#1 /var/www/devsvr1/vendor/magento/framework/Module/DbVersionInfo.php(79): Magento\Framework\Module\DbVersionInfo->isSchemaUpToDate('Magento_Custome...')
#2 /var/www/devsvr1/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(55): Magento\Framework\Module\DbVersionInfo->getDbVersionErrors()
#3 /var/www/devsvr1/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#4 /var/www/devsvr1/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#5 /var/www/devsvr1/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#6 /var/www/devsvr1/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#7 /var/www/devsvr1/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#8 /var/www/devsvr1/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(68): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#9 /var/www/devsvr1/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#10 /var/www/devsvr1/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#11 /var/www/devsvr1/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /var/www/devsvr1/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#13 /var/www/devsvr1/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#14 {main}

can anyone help me to fix this?
I already check the module of CustomerSampleData and there's a setup version.


texts: Magento 2 Cron jobs are stuck in Pending

texts:
I currently have a problem with the cron in my Magento 2 (2.2.7 installation).

Orders are coming through but any which come through from an extension called "Adyen" are getting stuck in the "Payment Review". This has been happening periodically for a while now but this morning all of the adyen payment orders are stuck in pending and we're getting a system message reading:

  You have 23 unprocessed notification(s). Please check your Cron and
  visit Magento DevDocs and Adyen Docs on how to configure Cron. Last
  cron check was: 08/03/2019 08:55:31

I have checked in the cron_schedule table and they seem to be getting stuck in the "pending" status as per the screenshot below:

I've also checked using SSH with the command: ./n98-magerun2.phar sys:cron:history | less

And there seem to be a large number of jobs with a "missed" status.

I've run the command: bin/magento cron:run several times but that has made no difference.

I also ran the following command:

username:~/httpdocs$ crontab -u username -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command

* * * * * /opt/plesk/php/7.0/bin/php /sites/website.com/httpdocs/bin/magento                                   cron:run
* * * * * /opt/plesk/php/7.0/bin/php /sites/website.com/httpdocs/update/cron                                  .php
* * * * * /opt/plesk/php/7.0/bin/php /sites/website.com/httpdocs/bin/magento                                   setup:cron:run

UPDATE

I have now checked through the cron_schedule and found a number of jobs which seem to be stuck in the "Running" status as per the screenshot below.

Looking across the internet at various sites it seems like this could be the problem, so I just wanted to know if this could indeed be causing the issue and if so can I simply delete the lines out of the database or is there something else I need to do?


texts: Magento 2.2.2 Plugin how to add custom field in request api

texts:
I've create a plugin to listen to api POST   /V1/order/:orderId/refund

and I would like to receive custom field. I've added a field for testing like: name:['test']

Body E.G:

{
    "items": [
        {
            "extension_attributes": {},
            "order_item_id": 7,
            "qty": 1
        }
    ],
    "isOnline": false,
    "notify": true,
    "appendComment": true,
    "name": [
      {
          "test": "ok"
      }
    ], //THIS IS MY CUSTOM FIELD
    "comment": {
        "extension_attributes": {},
        "comment": "refund has been created",
        "is_visible_on_front": 0
    },
    "arguments": {
        "shipping_amount": 0,
        "adjustment_positive": 0,
        "adjustment_negative": 0,
        "extension_attributes": {
            "return_to_stock_items": []
        }
    }
}

beforeExecute Method:

...
    /**
     * Create refund for invoice
     *
     * @param int $invoiceId
     * @param \Magento\Sales\Api\Data\CreditmemoItemCreationInterface[] $items
     * @param bool|null $isOnline
     * @param bool|null $notify
     * @param bool|null $appendComment
     * @param \Magento\Sales\Api\Data\CreditmemoCommentCreationInterface|null $comment
     * @param \Magento\Sales\Api\Data\CreditmemoCreationArgumentsInterface|null $arguments
     * @param mixed $name
     * @return int
     * @since 100.1.3
     */

    public function beforeExecute (
        \Magento\Sales\Model\RefundOrder $subject,
        $orderId,
        array $items = [],
        $notify = false,
        $appendComment = false,
        \Magento\Sales\Api\Data\CreditmemoCommentCreationInterface $comment = null,
        \Magento\Sales\Api\Data\CreditmemoCreationArgumentsInterface $arguments = null,
        array $name = []
    ) {
        print_r($name);die;
      }
...

My custom field name is an array similar to items: but I am receiving an empty array from Response:

Anyone any help Appreciated!


texts: Magento 2 - indexer error after data migration magento 1.9.1.1 to 2.3.2

texts:
I'm trying to migrate data to magento 2 using the data migration tool, the migration goes fine but the indexor crash during catalog_product_price index with the error :

       SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND dl.store_id = 0
     INNER JOIN `downloadable_link` AS `dll` ON dll.product_id =' at line 2, query was:
INSERT INTO `catalog_product_index_price_downlod_temp` SELECT `i`.`entity_id`, `i`.`customer_group_id`, `i`.`website_id`, MIN(IFNULL(dlpw.price_id, dlpd.price)) AS `min_price`, SUM(IFNULL(dlpw.price_id, dlpd.price)) AS `max_price` FROM `catalog_product_index_price_temp` AS `i`
     INNER JOIN `catalog_product_entity` AS `dl` ON dl.entity_id = i.entity_id AND dl.attribute_id =  AND dl.store_id = 0
     INNER JOIN `downloadable_link` AS `dll` ON dll.product_id = i.entity_id
     INNER JOIN `downloadable_link_price` AS `dlpd` ON dll.link_id = dlpd.link_id AND dlpd.website_id = 0
     LEFT JOIN `downloadable_link_price` AS `dlpw` ON dlpd.link_id = dlpw.link_id AND dlpw.website_id = i.website_id WHERE (dl.value = 1) GROUP BY `i`.`entity_id`,
            `i`.`customer_group_id`,
            `i`.`website_id` ON DUPLICATE KEY UPDATE `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`)

So, I've got an empty value in the querry :
INNER JOIN catalog_product_entity AS dl ON dl.entity_id = i.entity_id AND dl.attribute_id =  AND dl.store_id = 0

and that's pretty fun because catalog_product_entity doesn't have a attribut_id column anyway...
So if you've got an idea on how to solve this case i'm ready to listen


texts: Add custom Checkbox Columns to Custom Form Grid in Admin

texts:
I have added a custom Tab grid to Form Section in my custom module, now I need to add some custom Column of checkbox type to my custom grid, which I added as per snapshot -

but all the custom Checkbox are coming disabled, I need these checkboxes enabled.


texts: Checkout as guest setting name, lastname and email

texts:
I am creating a module who comunicates with Visa Checkout. When customer select Visa Checkout on cart I am setting this data:

Mage::getModel('checkout/cart')->getQuote()
            ->setCustomerFirstname($firstname)
            ->setCustomerLastname($lastname)
            ->setCustomerEmail($email)
            ->setCustomerIsGuest(true)
            ->save();

After this I redirect tthe customer to onepage and fill payment data (previously returned from Visa Checkout). I have modified the onepage to don't have billing and shipping information.

But when customer place the order an user is created. How can I disable the customer creation?


texts: Why can magento behat test not find my database?

texts:
The shop runs on my dev system with MAMP Pro without a problem.
But when I call bin/behat to execute my tests, I get this error:

test.dev bin/behat

  [Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [2002] No such file or directory

  [PDOException]
  SQLSTATE[HY000] [2002] No such file or directory

This is my composer.json:

{
  "require": {
    "php": ">=5.4.0"
  },
  "require-dev": {
    "magetest/magento-behat-extension": "dev-develop",
    "magetest/magento-phpspec-extension": "~2.0",
    "peridot-php/webdriver-manager": "dev-master",
    "bossa/phpspec2-expect": "dev-master",
    "behat/mink-extension": "*",
    "behat/mink-goutte-driver": "*",
    "behat/mink-selenium2-driver": "*",
    "behat/mink-selenium-driver": "*"
  },
  "autoload": {
    "psr-0": {
      "": [
        "html/app",
        "html/app/code/community",
        "html/app/code/core",
        "html/lib"
      ],
      "Mage" : "html/app/code/core"
    }
  },
  "config": {
    "bin-dir": "bin"
  }
}

And this is my behat.yml:

default:
  paths:
    features:  features
    bootstrap: features/bootstrap
  extensions:
    MageTest\MagentoExtension\Extension: ~
    Behat\MinkExtension\Extension:
      base_url: http://test.dev
      goutte: ~
      selenium2: ~
      default_session: selenium2

It's a patchwork of several tutorials while every of them threw the same error. My Magento installation is in html under project. Only thing that differs to all tutorials is, that I have no html/app/code/local folder.
Composer install and behat --init run without errors.

Edit:
I'm working with MAMP Pro, so I found this issue. But linking the socket file to /tmp did not fix my problem.


texts: is Mage::getModel('my_module')->getCollection()->getData(); ok performance wise?

texts:
For a homepage I am getting data like this from my module's table:

Mage::getModel('my_module')->getCollection()->getData();

I wonder if this is the best thing performance wise. There are only 6 rows in that table. Would it be better to load it like this:

for($i = 1; $i < 7; $i++){
    Mage::getModel('my_module')->load($i);
}

Thanks!


texts: how to install custom made language pack in magento 2?

texts:
I just found a language pack in zip format which contains

composer.json
language.xml
registration.php
zh_CN.csv
LICENSE
README.md

I'm going to edit the csv inside , but i don't know how to install it, anyone knows?

e.g where should i upload? what command should i run?


texts:
One of my pages suddenly became white screen as I was working on the code. It was working perfectly and it won't go back to normal even when I revert the change.

Every other page is working fine,the problem is just with one page.

I tried increasing the memory limit.(first to 1G and now to -1),still no change.

Could someone help me out?

My index.php

_DIR_ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
  \/* @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
error_reporting(E_ALL); ini_set('display_errors', 'on');
try {
    require _DIR_ . '/app/bootstrap.php';
} catch (\Exception $e) {
    echo <<

        Autoload error

    {$e->getMessage()}

HTML;
    exit(1);
}

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/* @var \Magento\Framework\App\Http $app /
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);


texts:
I am using Magento 1.9.2.4 and want to know what is the best way to export and import products from one Magento installation to another.

I read a lot of things but none of them worked for me. My current Magento store has multiple websites, configurable products etc. When I try the simple export (System > Import/Export > Export) it does not work because the new store (where I am importing the products) does not have multiple websites.

When I try to use the profile export (System > Import/Export > Dataflow - Profile) it does not work because the configurable products can't find the attributes set on the new store.

Is there a good way to "transfer" products from one installation to another?


texts:
Sometimes i see a strange gclid parameter in our url, for example: https://www.marington.nl/mode/tassen/shop/cognac/leer/?gclid=CI7s-5Xk-csCFVG6Gwod40EGCg.
How is this possible?

Thanks for your help!


texts: How to add images to product gallery programmatically in magento2?

texts: How to add images to product gallery programmatically in magento2...


texts:
I am working on a module for magento 2.x, I need to validate the code of this for which install the following module Magento Extension Quality Program Coding Standard  but trying to use it generates this error some idea.

ERROR: the "MEQP2" coding standard is not installed.


texts:
How can i fix the footer? I would like the individual blocks next to each other.

Thanks for your answer:)


texts: UPS is not working for heavy weight products

texts:
I have Magento ver. 1.9.1.1. I have used the default UPS shipping method and my setting for it as listed below.

Enabled for Checkout = yes
UPS Type = united parcel service
Gateway URL = http://www.ups.com/using/services/rave/qcostcgi.cgi
Packages Request Type = divide to equal rate
Container = customer packaging
Destination Type = residential
Weight Unit = LBS
Pickup Method = customer counter
Maximum Package Weight  = 5000
Minimum Package Weight  = 0.1
Calculate Handling Fee = fixed
Handling Applied = per package
Handling Fee = 0
Allowed Methods = all option selected
Free Method = none
Free Shipping with Minimum Order Amount = disabled
Ship to Applicable Countries = all allowed countries
Debug = no
Show Method if Not Applicable = no

Now I have two products A (weight : 150.0000) and B (weight : 111.0000)

When I add A to shipping cart and check "Estimate Shipping and Tax" for united states - delaware - 19702. It shows me as expected options for UPS. But when I add B after A and try "Estimate Shipping and Tax", it does not show any shipping method. When i check log it gives me:

  UPSOnLine5%The maximum per package weight for the selected service
  from the selected country is 150.00 pounds.%1035%

but my product have the larger weights.


texts:
Is it possible to make X% + X% discount in Magento? If yes, then how to achieve that.

Example: 5 + 5 off if the Cart Value is above 100 USD


texts:
When call block on custom view:

  $layer=$layout->createBlock('Magento\LayeredNavigation\Block\Navigation\Category');

  Exception #0 (RuntimeException): Illegal state
      #0 /home/httpdocs/generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php(63):
  Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->addFieldToFilter('category_ids',
  '169')
      #1 /home/httpdocs/vendor/magento/module-catalog-search/Model/ResourceModel/Fulltext/Collection.php(479):
  Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->addFieldToFilter('category_ids',
  '169')
      #2 /home/httpdocs/generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php(128):
  Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->addCategoryFilter(Object(Magento\Catalog\Model\Category\Interceptor))
      #3 /home/httpdocs/vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php(76):
  Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->addCategoryFilter(Object(Magento\Catalog\Model\Category\Interceptor))
      #4 /home/httpdocs/vendor/magento/module-layered-navigation/Block/Navigation.php(67):
  Magento\CatalogSearch\Model\Layer\Filter\Category->apply(Object(Magento\Framework\App\Request\Http))
      #5 /home/httpdocs/vendor/magento/framework/View/Element/AbstractBlock.php(273):
  Magento\LayeredNavigation\Block\Navigation->_prepareLayout()


texts: Update minicart.phtml when I update my product quantity

texts:
I have made a pair of modifications in "/app/design/frontend/Venustheme/mohawk/Magento_Checkout/templates/cart", a pair of lines that calculates number of carries through the price (If price is 300€, it´s a carry).

Well, my problem is that I buy a product with price 8.20€ and my minicart shows this:

It´s correct, but if I modify the quantity, it doesn´t change until I refresh de page:

WRONG:

CORRECT: (AFTER REFRESH THE PAGE)

The web only update the price, but no my lines...

Any solution to this? It´s going me crazy.

Thank you for your answers.


texts:
I want to Paytm payment integration. Please suggest me which is the better payment integration extension for India.

Please help me in this.


texts: Layout XML - Custom Layout Update not being used

texts:
I have set a layout update for a category in the admin (Custom Layout Update).

Here is the code incase that is not legible

<reference name="product_list">
    <action method="setTemplate"><template>catalog/product/list-sub-categories.phtml</template></action>
</reference>
<reference name="left">
    <block type="catalog/navigation" name="catalog.leftnav" before="-promo.container.1" template="catalog/navigation/left-main.phtml"/>
</reference>

This isn't reflected on that category page. The template used is still the default catalog/product/list.phtml

I have written an observer on "controller_action_layout_generate_blocks_before" to log the layout xml. At the very end of the log file the custom xml is present.

<reference name="product_list">
    <action method="setTemplate"><template>catalog/product/list-sub-categories.phtml</template></action>
</reference>
<reference name="left">
    <block type="catalog/navigation" name="catalog.leftnav" before="-promo.container.1" template="catalog/navigation/left-main.phtml"/>
</reference>

Caching is switched off and I've flushed the cache a few time to make sure. I'm a bit puzzled on this one. Anyone come across something similar? Or suggest further debugging steps.


texts: Magento2 - product collection category anchor filter

texts:
to filter products by certain category following code sample is used

<?php

$collection = $this->productCollectionFactory->create();
$collection->addCategoryFilter($category);

return $collection;

This does not return products from sub categories even though all categories are marked "Is Anchor" => "Yes".

How can I retrieve products from given category and it's sub-categories based on "Is Anchor" functionality?


texts:
i create a custom module in  Magento 2.4 .
I create an observer on the event "customer_register_success" . when i use graphql(i use pwa in frontend) the event is not firing but it work normally when i use the default magento frontend.any help please.thx


texts: Product AddToCart Product list page magento 1.9.1

texts:
I am using JavaScript function to add product to cart, below is my JavaScript code :

Ans the button code is:

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

But when I click addtocart  the different product is getting added to cart, please can anybody let me know what is the issue  in the above code ?


texts: Magento2 : How to access system.xml fields sortOrder parameter

texts: I would like to access the sortOrder parameter of some of the system.xml fields. Is it possible?


texts: Transactional Emails not sending to Hotmail

texts:
I am testing my transactional emails currently and have noticed that none of the emails are being sent to Hotmail addresses. I have tested with other addresses with personal domains and they receive fine, so too does Gmail account. But any Hotmail emails don't seem to get received.

Is there a reason for this? Is there a setting I'm missing?


texts: Magento 2 Programmatically set theme for specific store by store name or code

texts: how to programmatically assign a custom theme to a specific store, knowing the name and code of the store?


texts:
subject :—- Including top links(login/logout sign up under Account as dropdown select values)

I want to add login signup and login/out options inside account i.e account as dropdown menu where login , sign up and login/logout should be inside Account dropdown. Can please somebody guide me how to do this.. I tried but is default . .. Please help.. such that it should not effect the functionality . . . ..

regards


texts: Install the Magento 2.4.1 archive on local computer (Lubuntu 18.04.5)

texts:
I followed below link.
https://devdocs.magento.com/guides/v2.4/install-gde/prereq/zip_install.html
I set one user permission.
But...
When I typed 'sudo composer install' in magento root folder.
$sudo composer install

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Package sebastian/finder-facade is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
81 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PHP CodeSniffer Config installed_paths set to ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility


texts: magento loop through all products by product ids

texts:
My code is almost finished, but does not work..
The main idea is to assign one random related product to each product

<?php
set_time_limit(0);

require_once "blabla/app/Mage.php"; // my path
umask(0);
Mage::app();

 /**
     * Get the resource model
     */
    $resource = Mage::getSingleton('core/resource');

    /**
     * Retrieve the write connection
     */
    $writeConnection = $resource->getConnection('core_write');

$collection = Mage::getModel('catalog/product')->getCollection()->getAllIds();

foreach ($collection as $product) {
$mainId = $product;
$relatedId = array_rand($collection);//get a random ID from collection

    $query = "INSERT into catalog_product_link SET
    product_id = {$mainId},
    linked_product_id = {$relatedId},
    link_type_id = 1"

    /**
     * Execute the query
     */

     $writeConnection->query($query);

}
echo "finish!!";
 ?>

Final script, made by AreDubya:

   <?php
    set_time_limit(0);

    require_once "/blablabla/app/Mage.php";//my path
    umask(0);

    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

    $resource = Mage::getSingleton('core/resource');

    $writeConnection = $resource->getConnection('core_write');

    $ids = Mage::getModel('catalog/product')->getCollection()->getAllIds();
    foreach ($ids as $id) {
        $mainId = $id;
        $relatedId = $ids[array_rand($ids)];
        echo "$id - $relatedId<br/>";
        $query = "INSERT into catalog_product_link (product_id,linked_product_id,link_type_id) VALUES ($mainId, $relatedId ,1)";

        $writeConnection->query($query);
    }

    echo "done";

     ?>


texts: Prevent Stock Decrease if customer in a certain Customer Group places the order?

texts:
If the customer is in a certain customer group category, what is the most efficient way to prevent stock decrease once the order is placed?

I want the quantity to remain unchanged only for some customers after they place an order.


texts: Set text as url in Magento 2 Grid table records

texts:
I have a grid table that shows order id's only in text form, I want to change it into hyperlink format that redirect to order page based on the order id,
here's my grid:

        <column name="order_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" translate="true" xsi:type="string">Order ID</item>
                </item>
            </argument>
        </column>


texts: Upgrade Magento 1.9.2 admin footer version number

texts:
Today Magento v. 1.9.2 released. It includes SUPEE-6285 Patch.

Upgrade from 1.9.1.1 went well without any issues, however the footer in admin area shows: Magento ver. 1.9.1.1

Does anybody else faced it?


texts: Spambot protection fake customer registration

texts:
I want to reject all the registration of fake customers with a specific domain email.
Since the spambot can send the data through POST it does not enough create a new data-validate rule in the register.phtml file, so the validation should be server-side. Captcha is a bad option, I must avoid it.
Confirm registration email is active but I want to prevent to send an email.
How to do that? What the Observer is useful?


texts:
I have imported Configurable products
But It is showing like this

The parent product price and quantity is not imported only their variations price and quantity is imported
Can any suggest me why Is It shown Like this ???/


texts:
our site was hacked recently. we had backup , so we reverted and restricted site only to our ip , now we are trying to install all security patches. we installed 7405 , 5344 , 6482  patches. we cross  checked it by below code in applied.patch.list

2016-08-03 19:22:57 UTC | SUPEE-7405 | CE_1.8.1.0 | v1.1 | 7abc9e2aeabfd6fe2adb9ec5aeaa1338e3100178 | Fri Feb 5 13:26:33 2016 +0200 | 7b9c8a8353510903624d8d9ce11b982811dd0df5..7abc9e2aeabfd6fe2adb9ec5aeaa1338e3100178
patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
patching file app/code/core/Mage/Core/Model/Config.php
patching file app/code/core/Mage/Sales/Model/Quote/Item.php
patching file lib/Varien/File/Uploader.php

2016-08-03 19:49:41 UTC | SUPEE-5344 | EE_1.14.1.0 | v1 | a5c9abcb6a387aabd6b33ebcb79f6b7a97bbde77 | Thu Feb 5 19:14:49 2015 +0200 | v1.14.1.0..HEAD
patching file app/code/core/Mage/Admin/Model/Observer.php
patching file app/code/core/Mage/Core/Controller/Request/Http.php
Hunk #2 succeeded at 537 (offset -4 lines).
patching file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
patching file app/code/core/Mage/XmlConnect/Model/Observer.php
patching file lib/Varien/Db/Adapter/Pdo/Mysql.php

2016-08-03 19:55:03 UTC | SUPEE-6482 | CE_1.9.2.0 | v1 |  | Tue Jul 14 14:17:04 2015 +0300 |
patching file app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
Hunk #1 succeeded at 209 (offset -24 lines).
patching file app/code/core/Mage/Catalog/Model/Product/Api/V2.php

now 5994 , 6788 , 6285 patches are left.

Now when we include below code in patch.php file and ran in browser , we got below errror.

patch.php

<?php
print("<PRE>");
passthru("/bin/bash PATCH_SUPEE-5994_CE_1.6.0.0_v1-2015-05-15-04-34-46.sh");
print("</PRE>");
echo "Done";
?>

error :

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php
patching file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
patching file app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
patching file app/code/core/Mage/Customer/Model/Customer.php
patching file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php
The next patch would create the file app/code/core/Mage/Install/Controller/Router/Install.php,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
patching file app/code/core/Mage/Install/etc/config.xml
patching file app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php
patching file downloader/Maged/Model/Connect.php
patching file downloader/Maged/View.php
patching file downloader/template/connect/packages_prepare.phtml
patching file downloader/template/messages.phtml
patching file get.php
patching file lib/PEAR/PEAR/PEAR.php
The next patch would create the file lib/PEAR/PEAR/PEAR5.php,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
patching file lib/Varien/Io/File.php
Done


texts:
Does anyone know how to prevent your custom theme from inheriting from a parent theme like blank or luma?

This apparently is adding its own css, and js, files to the page and is interfering with our own custom css, and js, files.  And this is causing the store or page not to display correctly, or the way we want.

Thanks,
Mike


texts:
If anyone can help in regards the alt attribute, on

Where it is entered in Magento
How it can be entered?


texts: Restrict to 2 digits after decimal point in Price

texts:
we are using following code to display price in frontend.

 <span id="valueprice_<?php echo $products->getId(); ?>"><?php echo $products->getPrice(); ?>
    <input type = "text" id = "price_<?php echo $products->getId(); ?>" onkeydown="validateNumbers(event)" "name = "price" value = "<?php echo $products->getPrice(); ?>" />

in frontend price is displaying as follows.
suppose if price is 100, than its displaying as 100.0000 .

after decimal points, 4 zeros [numbers] are displaying. I want to restrict to only 2 numbers after decimal point.


texts: Magento 2.2.1 - Admin Product Export Problem

texts:
When i try to export product to CSV. My Admin panel get's wierd. Please take a look at the screenshot. The Admin Panel is getting shifted to the Admin Workarea and export never works.

Any help here. Please check the screenshot and check for Red Arrow, The complete Left Admin Panel is getting shifted to content area and product export stops working.

Warm Regards,

Venkatesha


texts: Client denied by server configuration /app/etc/config.php

texts:
I just installed Magento 2 on HostGator with Linux+Cpanel.

Everything seems to work fine, however, any change I do on the Configuration it keeps loading and loading and never applies.

I checked the server logs and it shows:

[Thu Mar 03 11:40:43 2016] [error] [client 108.167.165.191] client denied by server configuration: /home3/e9u3j7z1/public_html/magento/app/etc/config.php

The file has 644 permission, because it is required by Cpanel, I tried to change it to 755, 777, 775 but it doesn't solve the problem.

Someone could help?


texts:
This is driving me crazy. How do I disable free shipping after someone enters a promotional/discount code? I want this to be an either/or scenario. They can't get the discount and free shipping!

Ok..I have enabled the "Free Shipping" method and set the minimum order amount to $75. I've also created a shopping cart price rule for the discount I want to offer with the following selections:

Conditions:
If ALL are TRUE: Subtotal is greater than $75.00

Actions:
Apply - Percent of Product....
Discount Amount - 0
Apply to Shipping - Yes
Free Shipping - For shipment with matching items
Stop Further Rules Processing - No

This priority rule is set to "2".

I've left the Conditions section as default and have selected the following options under "Actions":

Apply - Percent of product discount
Discount Amount - 15
Apply to Shipping Amount - No
Free Shipping - No
Stop Further Rules Processing - No

The priority for this rule is "1"

Finally, it might be worth noting that I'm still on version 1.4.1.1. Scary...I know.

Any help would be appreciated. I'm dying over here!


texts: How to update bulk of customer address information?

texts:
I have one requirement to update the customer first name and last name in address information section. I tried through csv file import/export method but it only update in account information section not in address information such as billing and shipping address in admin panel(customer->manage customer section).

Currently few records in customer information section are present with lastname combine in firstname section (e.g firstname:- testtest1 and lastname:- blank instead of firstname:-test and lastname: test1)

and I want to split the firstname and lastname separately in address information section too.

So how should I proceed to solve this query to my bulk of customer.


texts:
I am creating a product programaticlly, and sometimes I need to add a new option to some product attribute.
For adding the new option my code is:

$option = array();
$option['attribute_id'] = $attribute->getId();
$option['value']['$attributeValue'][0] = $attributeValue;

$eavSetup = $eavSetupFactory->create();
$eavSetup->addAttributeOption($option);

If I do a

$attribute->getSource()->getOptionId($attributeValue);

to get the new optionId, nothing is returning, and then I can not add this attribute value to my new product.

If I go to backend the new attribute is being created.

Do anyone knows how can I get the Id from my new created attribute option?


texts: I was going through Magento 2 open issues because I want to contribute. I would like to know What G1 passed, G2 label passed labels mean.


texts: Magento 2.3 Split database, I have facing issue for fetch records

texts:
I'm using magento 2.3, for some customisation we are using joins tables for show the records on the grid in admin.
Now we splited our database so, Now join tables are not working. Is any other way to fetch the records from the splited database.?


texts: How to find class by function name in PHP class?

texts:
For example I have a class A which extends class B and B extends C and so on.

Now I can get all the function which is accessible in class A by php function getClassMethods($this);

But if I found a function call in Class A like $this->someFunction(); and because of Abstraction, I unable to find in which class the someFuntion() is defined.

Is there any way to find this ?


texts:
it
Is it possible to integrate magento 1.9.x with lib React.JS?
because I read about it but most of post says about magento 2.


texts: Magento2 : How to remove Personal Information from customer account registration page

texts: I want to remove this Personal Information block.


texts: Magento 2 : Add Custom Tax Amount In Cart Programatically

texts:
I want to add custom tax amount to checkout cart programmatically.

Here is the example.

Cart Old Tax = 4.21

Custom Tax = 2

New Tax = 4.21 + 2 = 6

Check the screenshot below.

I need this done programmatically.


texts:
When i import a csv file with product everythings is ok. Images are on admin product page. But in frontend there is nothing, just the broken image with the alt.

When i go to the image in admin and i press save (i do nothing, just direct save) the image appear in frontend.

I already try : setup:static-content:deploy index:reindex cache:clean

I don't know if you understand well, my english isn't very good.


texts: Import products: Replace existing complex data by default

texts:
I'm using Import function to import my products on my eCommerce web site. Since i dont need Append complex data function, could it be done, that the function Replace Existing Complex data" is selected by default.

Thanks,


texts: How to prevent customer from change DOB?

texts: We want to use a function that will give customers free points when their birthday? But how to prevent customers to change DOB now and then to get extra birthday points?


texts: what is this function work in admin grid?

texts:
I want to know what is this function functionality in admin grid.

protected function _afterLoadCollection()
{
    $this->getCollection()->walk('afterLoad');
    parent::_afterLoadCollection();
}


texts: Magento 2 slow - Dom::_getMatchedNode & Dom::_mergeNode taking 15+ seconds

texts:
Magento 2.3.3
New relic is showing that 2 items are causing slow page loads:
Magento\Framework\Config\Dom::_getMatchedNode  (8 seconds)
Magento\Framework\Config\Dom::_mergeNode  (6 seconds)

I'm trying to debug this but I'm not sure what is causing this.
Anyone have any ideas what is going on or why these methods might be causing issues? (or what these methods are actually doing)
I have disabled ALL 3rd party modules so I only have core Magento modules running. But still the same.
Thanks


texts:
Ok. Thats what i want to do:

If somebody bought 1 product from Category_1, recive free shipping.
If somebody bought 2 products from Category_1, recive 10USD discount and free shipping.
If somebody bought 3 products from Category_1, recive 30USD discount and free shipping.
...
If somebody bought 1 product from Category_1, and 1 product from Category 2, no discount.
If somebody bought 2 products from Category_1, and 1 product from Category 2, 10 USD discount.
If somebody bought 3 products from Category_1, and 1 productfrom Category 2, 20USD discount.
...
If somebody bought 1 product from Category_1, and 2 producst from Category 2, 10USD discount.

SOmething like that. How i can operate that thing?


texts: How can I generate a restore cart link in Magento?

texts:
While Magento has a support for a persistent cart, I'd like to send out a restore-cart link in Magento.

Clicking this link should restore your cart contents even if you don't have an existing session in Magento. I've been looking for references for an implementation such as this but haven't had any luck.


texts: How to remove Guam, Palau, and other US Territories from address State dropdown - Magento 2

texts:
How can I remove Guam, Puerto Rico, Palau, and all other US Territories from the "State" (or "Region") dropdown list on both the cart page and checkout pages?

I only want to ship to the 48 contiguous states.


texts:
I have a type of product that needs a "setup fee" that depends on a selection of a custom option.

I tried to set a price for the custom option but the problem is that this price is multipled by the quantity.

What I'm looking for is:

product A costs X
product A plus option costs X + FEE
N product A with option costs (N * X) + FEE

Any solution?


texts: Override Adminhtml Core Controller not working (EE 1.14)

texts:
I would like to override the core Controller.

Path: app\code\core\Mage\Adminhtml\controllers\Sales\OrderController.php

And then, I create the custom extension for overriding this controller.

Here is my file structure:

config: app\code\local\Mypackage\MyModule\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mypackage_MyModule>
            <version>0.1.0</version>
        </Mypackage_MyModule>
    </modules>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Mypackage_MyModule before="Mage_Adminhtml">Mypackage_MyModule</Mypackage_MyModule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

controllers: app\code\local\Mypackage\MyModule\controllers\Sales\OrderController.php

<?php
require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml').DS.'Sales_OrderController.php';

class Mypackage_MyModule_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController
{
    /**
     * View order detale
     */
    public function viewAction()
    {
        $this->_title($this->__('Sales'))->_title($this->__('Orders'));

        //etc...
    }
}

However, it don't work.

Any suggestion for me? Please help. Thank you.

EDIT:

I am using EE 1.14

EDIT2:

I had modified these file:

config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Mypackage_MyModule>
            <version>0.1.0</version>
        </Mypackage_MyModule>
    </modules>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Mypackage_MyModule before="Mage_Adminhtml">Mypackage_MyModule_Adminhtml</Mypackage_MyModule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

app\code\local\Mypackage\MyModule\controllers\Adminhtml\Sales\OrderController.php:

<?php
require_once(Mage::getModuleDir('controllers','Mage_Adminhtml').DS.'Sales' . DS . 'OrderController.php');

class Mypackage_MyModule_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController
{
    /**
     * View order detale
     */
    public function viewAction()
    {
        die(":D"); //for test
    }
}

But still don't work:(

Modules : app/etc/modules/Mypackage_MyModule.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mypackage_MyModule>
            <active>true</active>
            <codePool>local</codePool>
        </Mypackage_MyModule>
    </modules>
</config>

EDIT3:

I had found the issue. The problem had written on below reply message.


texts: How to get category list with id from database: Magento 2

texts:
I want to query the all product categories name and id from the magento 2.1 database. I found the sql query but it showing the error.

  unknown column entity_type_id in catalog_category_entity

SQL Query

 SELECT DISTINCT cc.entity_id as id, cc.value as path, cc1.value as name
  FROM catalog_category_entity_varchar cc
  JOIN catalog_category_entity_varchar cc1 ON cc.entity_id=cc1.entity_id
  JOIN eav_entity_type ee ON cc.entity_type_id=ee.entity_type_id
  JOIN catalog_category_entity cce ON cc.entity_id=cce.entity_id
  WHERE cc.attribute_id = '57' AND cc1.attribute_id = '41' AND ee.entity_model = 'catalog/category';


texts: Magento 1.9.1 Catalog price rule "is not one of" doesn't work

texts:
I am using Magento 1.9.1 and I trying to implement this Catalog Price Rule:

IF ALL these conditions are TRUE

SKU is not one of SKU1, SKU2, SKU3 -->This rule doesn't works.

It works only on this way:

SKU is not one of SKU1

SKU is not one of SKU2

SKU is not one of SKU3

Is this a magento Bug?


texts: magento 2 how to fill general information of store programmatically?

texts:
I wan't to fill information of a store , this information:

Store Name
Store Phone Number
Country
Region/State
Postal Code
City
Street Address

I know how to get this information like below:
public function getStorename()
    {
        return $this->_scopeConfig->getValue(
            'trans_email/ident_sales/name',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }

 public function getStoreEmail()
    {
        return $this->_scopeConfig->getValue(
            'trans_email/ident_sales/email',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }

is there a method called setValue() ?
greetings!


texts: Problem with configurable product images

texts:
hopefully someone here can help me out please...

I've added a configurable product with 3 individual colour attributes. Everything is working fine, apart from one colour combination.

If you visit http://newsite.yummykids.co.uk/bugaboo-bee3.html and try selecting any combination, it all works as it should, apart from if you select Black Frame with Soft Pink Canopy, and then try choosing any Seat colour - the product image fails to update as it does with all the others. I've uploaded these in the same way throughout so I have no idea why this is happening!

There are 64 images uploaded in total and it's just these four which aren't working.

One thing I've noticed (perhaps unrelated) is that the colour name needs to be unique for each attribute, which is why I've added 'Canopy' and 'Frame' to the colour names. Can anyone elaborate on this further?

I have cleared all caches and indexes.

Any assistance most appreciated - thank you!


texts:
I would like to redirect the admin upon login to my custom module dashboard. I do not want to override the existing dashboard, but run them in parallel. So I've done the following:

config.xml:

<admin_session_user_login_success>
    <observers>
        <module>
            <type>singleton</type>
            <class>Namespace_Module_Model_Observer</class>
            <method>custom_dashboard_redirect</method>
        </module>
    </observers>
</admin_session_user_login_success>

Observer.php:

public function custom_dashboard_redirect(){
    Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('*/custom_dashboard/*'));
    Mage::app()->getResponse()->sendResponse();
    exit;
}

Unfortunately this seems to simply redirect to the standard dashboard.

However, if I redirect to sales_order instead of custom_dashboard, it does the redirect correctly.

P.S. I can acccess custom_dashboard fine through the menu I've created, just not via this redirect. Would appreciate some pointers


texts: Is there a generic block to create a title via layout xml?

texts:
I want to add a title to a block with nothing more than layout xml, is there a generic class or block that I can use for this?

I've just tried page.title.main's class and template but it is too big and you can't pass a parameter for which html heading tag to use. Is there another? I cannot find it in the framework folder either.

    <block class="MyDesiredMAGENTOClass" name="account.navigation.title" template="html/title.phtml">
        <arguments>
            <argument name="css_class" xsi:type="string">test</argument>
            <argument name="tag" xsi:type="string">h#</argument>
            ...
            ...
        </arguments>
    </block>


texts: Where does "logic" go? Blocks and accessing Models

texts:
Let's say I have a custom Admin module that simply checks the magento database for cache settings. I want to pull the results to the page I created in admin.

I have a view in /design/adminhtml/default/default/templates/upgradecheck/view.phtml
I have the layout file in /design/adminhtml/default/default/layout/upgradecheck.xml

and then I have my custom module (Myname_Upgradecheck).

Everything "works" - as in when I load that page, it displays exactly the text I would expect (e.g. "1 cache is enabled"). My question is, did I do this correctly? Should the logic be in another file that just returns how many cache types are enabled and then call that function from the block? How exactly would I do that if that needs to be done?

class Myname_Upgradecheck_Block_Adminhtml_Upgradecheck extends Mage_Adminhtml_Block_Template {
public function showCacheCount()
{
    $cachecheck = Mage::getModel('upgradecheck/cachecheck')->getCollection();
    $check = array();
    foreach($cachecheck as $cache){
        if ($cache->getValue() != 0) {
            array_push($check, $cache->getCode());
        }
    }
    if (count($check) != 0) {
        return count($check) . ' caches are enabled';
    }
    return 'No cache types are enabled';
}

}

In my view.phtml file I just have: echo $this->showCacheCount();


texts: Price from ERP system - product price in category view.

texts:
I am working on manipulating the magento product prices, so that the price is retrieved from an ERP system - instead of from the magento mysql.

So far, I have the succeeded with the prices in the product view, cart, orders etc.

However, the price displayed on the category view is giving trouble.

Can anyone kindly enlighten me on where the price "Special Price: 1,00 kr" is generated for this view? The price "1,00" is taken from the Magento DB currently, so I need to override that price in this view - similar to the product view.

Thank you


texts: UiComponent export button issue, error: getRowData() must be an instance of Magento\Framework\Api\Search\DocumentInterface (Solved by myself)

texts:
I am using Ui-Component for export button for export grid column with below code:

<exportButton name="export_button" />
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="selectProvider" xsi:type="string">test_listing.test_listing.test_columns.ids</item>
        </item>
     </argument>
</exportButton>

Anyone have faced this kind of issue...
Please let me know if i need to post my Dataprovider class

My collection file is below:

class Collection extends TestCollection implements SearchResultInterface
{
     /**
     * {@inheritdoc}
     */
    public function getAggregations()
    {
        return $this->aggregations;
    }

    /**
     * {@inheritdoc}
     */
    public function setAggregations($aggregations)
    {
        $this->aggregations = $aggregations;
    }

    /**
     * {@inheritdoc}
     */
    public function getSearchCriteria()
    {
        return null;
    }

    /**
     * {@inheritdoc}
     */
    public function setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null)
    {
        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getTotalCount()
    {
        return $this->getSize();
    }

    /**
     * {@inheritdoc}
     */
    public function setTotalCount($totalCount)
    {
        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function setItems(array $items = null)
    {
        return $this;
    }
}

  Fatal error:  Uncaught TypeError: Argument 1 passed to
  Magento\Ui\Model\Export\MetadataProvider::getRowData() must be an
  instance of Magento\Framework\Api\Search\DocumentInterface,
  instance of Package\Module\Model\Test given, called in
  /home/ashish/magentoPro/vendor/magento/module-ui/Model/Export/ConvertToCsv.php
  on line 84 and defined in
  /home/ashish/magentoPro/vendor/magento/module-ui/Model/Export/MetadataProvider.php:147 ...


texts: Total Discount In Minicart Magento 2. Plugin is ready but how can I display it?

texts:
Trying to do like this:

I've created a Plugin, but where minicart template is placed? And how can I display the discount via knockout? Thank you.
app/code/Vendor/Checkout/Plugin/Cart.php:
<?php

namespace Vendor\Checkout\Plugin;

class Cart
{
    protected $checkoutSession;
    protected $checkoutHelper;
    protected $quote;

    public function __construct(
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Checkout\Helper\Data $checkoutHelper
    ) {
        $this->checkoutSession = $checkoutSession;
        $this->checkoutHelper = $checkoutHelper;
    }

    /**
     * Get active quote
     *
     * @return \Magento\Quote\Model\Quote
     */
    protected function getQuote()
    {
        if (null === $this->quote) {
            $this->quote = $this->checkoutSession->getQuote();
        }
        return $this->quote;
    }

    protected function getDiscountAmount()
    {
        $discountAmount = 0;
        foreach($this->getQuote()->getAllVisibleItems() as $item){
            $discountAmount += ($item->getDiscountAmount() ? $item->getDiscountAmount() : 0);
        }
        return $discountAmount;
    }

    public function afterGetSectionData(\Magento\Checkout\CustomerData\Cart $subject, $result)
    {
        $result['discount_amount_no_html'] = -$this->getDiscountAmount();
        $result['discount_amount'] = $this->checkoutHelper->formatPrice(-$this->getDiscountAmount());

        return $result;
    }
}


texts: Migrating all features of store in Volusion to Magento

texts: I’m facing a large number of different problems with my Volusion cart now. What I was thinking of is moving to Magento. The thing is, I want to move not only products, customers and orders but also SEO URLs. So, I’m wondering if there is some extension that would do this? Will be grateful for any ideas!


texts: Datepicker on register form in magento 2.3

texts:
I want to add datepicker for selection of date of birth on customer account registration form.

https://prnt.sc/orlaam

I am using the default block  <?php $_dob = $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Dob')
This block works fine on other form, but the same block when used on account registration form it does not work.
What can be the issue?


texts:
This is my code:

  magento/app/code/UV/Download/etc/frontend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch_checkout_cart_add">
        <observer name="UV_Download_Before" instance="UV\Download\Observer\CartObserver" />
    </event>
</config>

  magento/app/code/UV/Download/Observer/CartObserver.php

<?php
namespace UV\Download\Observer;

use Magento\Framework\Event\ObserverInterface;

class CartObserver implements ObserverInterface
{
    public function __construct()
    {

    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $product = $observer->getEvent()->getProduct();

    }
}
?>

This observer gets called when someone is clicking "Add to Cart".
My goal is to get the product which belongs to the "Add to Cart"-Button.

How can I do that?

Thanks!


texts: SetBillingAdress not working (prog) on quote

texts:
I'm creating orders programmaticaly but my billings address are not updating.

I can set the shipping address that I want (another from the connected user) but the billing is still the one from the connected user.

See :

            $store=$this->_storeManager->getStore();
        $websiteId = $this->_storeManager->getStore()->getWebsiteId();
        $customerTemp=$this->customerFactory->create();
        $customerTemp->setWebsiteId($websiteId);
        $customerTemp->loadByEmail($orderData['email']);// load customet by email address
        $quote=$this->quote->create(); //Create object of quote
        $quote->setStore($store); //set store for which you create quote
        $customer= $this->customerRepository->getById($customerTemp->getEntityId());
        $quote->setCurrency();
        $quote->assignCustomer($customer); //Assign quote to customer
        $objectManager = ObjectManager::getInstance();
        $codeClient = $orderData["code_client"];
        //add items in quote
        $comment = $orderData["comment"];
        foreach($orderData['items'] as $item){
            //add products
        }

        //Set Address to quote
        $quote->getShippingAddress()->addData($orderData['shipping_address']);
        $billings = $quote->getBillingAddress()->addData($orderData['shipping_address']);
        // Collect Rates and Set Shipping & Payment Method
        $shippingAddress=$quote->getShippingAddress();
        $shippingAddress->setCollectShippingRates(true)->collectShippingRates();
        $this->shippingRate->setCode('flatrate_flatrate');
        $shippingAddress->setShippingMethod('flatrate_flatrate'); //shipping method
        $quote->getShippingAddress()->addShippingRate($this->shippingRate);
        $quote->setCouponCode("")->collectTotals();
        $this->quoteRepository->save($quote);
//        $quote->save(); //Now Save quote and your quote is ready        // Set Sales Order Payment
        $quote->getPayment()->importData(['method' => 'checkmo']);
        // Collect Totals & Save Quote
        $quote->collectTotals();
        $this->nice($quote->getBillingAddress()->getCity());
        die;
        $this->quoteRepository->save($quote);


texts: Magento 2: Custom module to override the logo.phtml file of the custom theme

texts:
Naming the custom module to override the logo.phtml file found at the path seen in the screenshot below a bit confusing to me as the module name is too long to decide on the naming. The vendor of the custom theme being used is Swissup.

I know the module name should begin with Swissup_(What comes here) with me not being able to figure out how to complete the module name after Swissup_.
Any advice or help, please.


texts: Is there a generic way I can apply input filtering to Magento form processing?

texts:
In checking my Magento-powered site for XSS, I've found a couple of problem forms in our custom code, that let users submit arbitrary HTML and script tags that we dutifully inject into our site.  (This isn't a Magento bug.)

Instead of trying to always remember to apply a filter on output, I'd like set a PHP filter by default on all input--like filter.default = full_special_chars in /etc/php.ini. Then, if specific input data needs specific exceptions, use a filter_input() call with a more-correct filter (e.g., this input is an email address, so use FILTER_SANITIZE_EMAIL).

I know how to implement this in 100% scratch PHP code, but is there a "magento way" to achieve this?


texts: Magento 2: Run setup:di:compile a Specific Module

texts:
Is it possible to di compile to specific module instead of whole magento di compile ?

Because, Whole Magento take a long time to compile. So, is it possible to di compile to specific module.

php bin/magento setup:di:compile CompanyName_ModuleName

Please help me. If it is possible.


texts: Check if block rendered and displayed on the current page

texts:
Is there any way I can check if a block is displayed on the current page?

I have a block my.banner with simple image. This block is added to the left sidebar on many different types of pages, e.g. on category pages, on custom CMS pages etc.

<default>
    <reference name="header">
        <block type="mymodule/header" name="my_header" template="header.phtml" />
    </reference>
</default>
<cms_page>
    <reference name="left">
        <block type="mymodule/banner" name="my.banner" template="banner.phtml" />
    </reference>
</cms_page>
<catalog_category_default>
    <reference name="left">
        <block type="mymodule/banner" name="my.banner" template="banner.phtml" />
    </reference>
</catalog_category_default>
...

Then, in another block my_header in the header I need to programmatically check if my.banner block will be actually displayed on the current page. If it's not displayed, then in the header I need to display additional info for customers.

I can check if the my.banner exists in the layout:

$block = $this->getLayout()->getBlock('my.banner');
if ($block !== false)
{
    //...banner exists
}

But this is not a solution, because the problem is that admin can any time disable the left sidebar (e.g. on selected category page). And if the left sidebar was removed, then my.banner will not be displayed even if it's added to the sidebar in layout.

So is there any way I can check if my.banner block will be actually rendered and displayed on the page?
And if it's possible in Magento 1, what is equivalent in Magento 2?


texts: How do i get my size attribute values in fronend? I have created size attribute as multiselect option

texts:
I want all selected size in frontend

$categories = $this->getCurrentChildCategories();
$count = is_array($categories)?count($categories):$categories->count();
$product = Mage::getModel('catalog/product');

$sizeLabel = $product->getAttributeText('size');

<?php if ($count): ?>

                <?php echo $this->__('Sub Category'); ?>

                    <?php foreach ($categories as $category): ?>
                        <?php if ($category->getIsActive()): ?>

                                <a href="<?php echo $this->getCategoryUrl($category); ?>" <?php if ($this->isCategoryActive($category)): ?>class="current"<?php endif; ?>>
                                    <?php echo $this->escapeHtml($category->getName()); ?>
                                    <?php echo $category->getProductCount(); ?>

                        <?php endif; ?>
                    <?php endforeach; ?>

            <?php echo $sizeLabel;?>

<?php endif; ?>