texts: show a custom attribute instead of full name if customer logged in M2

texts:
I want to display in top menu my custom attribute instead of full name customer, I tried to override customer.phtml under design my theme but no result please any help

    <?
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $customerRepositoryInterface = $objectManager->create('\Magento\Customer\Api\CustomerRepositoryInterface');
    $customerSession = $objectManager->create('Magento\Customer\Model\Session');
    if($customerSession->isLoggedIn()) {
        $customerId = $customerSession->getCustomer()->getId();
        $customeratt = $customerRepositoryInterface->getById($customerId);
        $customAttributeCode = 'custom_name';
        echo $cattrValue = $customeratt->getCustomAttribute($customAttributeCode); //Please echo this line when you want display custom name.
    }
?>

now i can't find my top menu here is the code of default.xml under my theme `

and here is the code of my default.phtml under customer_module under my theme

  <referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>

    <!-- Product review link -->
    <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>

    <!-- My credit card link -->
    <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>

    <!-- Account link -->
    <referenceBlock name="customer-account-navigation-account-link" remove="true"/>

    <!-- Account edit link -->
    <referenceBlock name="customer-account-navigation-account-edit-link" remove="true"/>

    <!-- Orders link -->

   <!-- <referenceBlock name="customer-account-navigation-orders-link" remove="true"/>

-->

    <!-- Wish list link -->
    <referenceBlock name="customer-account-navigation-wish-list-link" remove="true"/>
    <referenceBlock name="top.links">
        <referenceBlock name="register-link" remove="true" />           <!--for Create Account Link-->
        <referenceBlock name="authorization-link" remove="true" />      <!--for Sign In Link  -->
        <referenceBlock name="wish-list-link" remove="true" />          <!--for WishList Link-->
    </referenceBlock>

    <referenceBlock name="header">
        <arguments>
            <argument name="show_part" xsi:type="string">other</argument>
        </arguments>
    </referenceBlock>

    <move element="authorization-link" destination="header-wrapper" after="minicart"/>
    <referenceBlock name="reviews.tab" remove="true" />
    <referenceBlock name="product.review.form" remove="true" />
    <referenceBlock name="product.info.review" remove="true" />
    <referenceBlock name="product.info.details" remove="true"></referenceBlock>
    <referenceBlock name="catalog.compare.sidebar" remove="true"/>
    <referenceBlock name="view.addto.compare" remove="true" />
    <referenceBlock name="view.addto.wishlist" remove="true" />

<?xml version="1.0"?>

        <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login" template="account/link/authorization.phtml"/>
    </referenceBlock>
    <block class="Magento\Theme\Block\Html\Header" name="header" as="header">

        <arguments>
            <argument name="show_part" xsi:type="string">welcome</argument>
        </arguments>
    </block>
    <move element="header" destination="header.links" before="-"/>
    <move element="register-link" destination="header.links"/>

    <move element="top.links" destination="customer"/>

    <move element="authorization-link" destination="top.links" after="-"/>

</body>


texts: Attributetext not showing on category pages

texts:
Trying to show an attributetext of an attribute at each product on category pages. Got the following code:

<?php
    $attributeSetModel = Mage::getModel("eav/entity_attribute_set");
    $attributeSetModel->load($_product->getAttributeSetId());
    $attributeset = strtolower($attributeSetName = $attributeSetModel->getAttributeSetName());
    if($attributeset == 'seeds'):
    echo '
' . $_product->getResource()->getAttribute('qty_seeds')->getStoreLabel() . ': ';
    echo $_product->getAttributeText('qty_seeds');
    echo '
';
    endif;
?>

The label does show but not the text... any one know why and how to fix it?


texts: make a bundle offer from simple products

texts: actually i have a problem similar to the above request; I want to make a bundle product or grouped from 1 quantity each of two simple products; and like that, the client will add to cart 1 bundle or maybe more. how can i do this? thanks in advance for help and support!!


texts: Magento Extension "Amazon Sales Channel" Not importing photos

texts: I have Amazon Sales Channel installed on my Magento 2.3.3 CE store. Im using it to install and sync my amazon store with over 170,000 used books. My problem is that its not importing the photos. Any ideas?


texts:
i have a issue when a try to access to my Magento Admin Panel and frontend default page.

the admin panel always shows epmty And the frontend default page show content but without CSS and JS:

how to fix it?

Admin panel: SS1 Default Frontend: SS2 Using: Windows - Xampp - Magento 2.3 - Chrome Browser


texts: Magento 2.1 EE Show minicart on mouse hover instead of onclick

texts: I want to develope minicart should open onhover of it instead of onclick in magento 2.1 EE help me thank you


texts: Magento 2: get a list of all plugins (interceptors) and preferences

texts: Is there a way I can retrieve the list of all plugins (with the methods they're plugged onto) and all preferences (and their original class) on a Magento 2 install.


texts:
What are some good resources to learn Magento 2?

I'd like a large list of resources, in order, from starting out to complete mastery, if you guys have them available.

The big thing I'd like is free resources, even if it's a hundred hour YouTube playlist, that's fine.

Just looking for resources to learn.


texts: How to Create mobile and Desktop menu same Magento 1.9?

texts:
I am installing One Theme of Magento 1.9 and in this theme have mobile
  and the desktop menu was Different. Please anyone Can Help me how I
  can do the same.

Website: http://nn.packparadise.com

  Thank you in Advance


texts: I created a grid in the Magento admin, but the functionality like sort, filter and search doesn't work and that is because I didn't use a database table to get the information. I use a web service that connects with redmine and I get all the information. I reviewed and I founded that the default sort, search and filter of the Magento grid only works with models or collections, but I can't find a way to do the same but with my own collection (in this case the info that I get from the web service)


texts: Magento 2 Order Email With This Content =0D=0A=0D=0A=0D=0A =0D=0A

texts:
When order confirmation send all content contain this

  =0D=0A=0D=0A=0D=0A =0D=0A

Here is email screenshot:

  app\Vendor\Extension\etc\di.xml

<preference for="\Magento\Sales\Model\Order\Email\SenderBuilder" type="Vendor\Extension\Model\Template\SenderBuilder"/>

  Here is Vendor\Extension\Model\Template\SenderBuilder\send.php

  Here is my send function for PDF attache

public function send()
    {
        $objectManager = ObjectManager::getInstance();
        $configHelper = $objectManager->get(Data::class);
        if ($configHelper->versionCompare("2.3")) {
            # attach pdf, overide send function
            $attachPdf = $this->attachPDF();
            $this->configureEmailTemplate();
            $this->transportBuilder->addTo(
                $this->identityContainer->getCustomerEmail(),
                $this->identityContainer->getCustomerName()
            );
            $copyTo = $this->identityContainer->getEmailCopyTo();
            if (!empty($copyTo) && $this->identityContainer->getCopyMethod() == 'bcc') {
                foreach ($copyTo as $email) {
                    $this->transportBuilder->addBcc($email);
                }
            }

            #transport email
            $transport = $this->transportBuilder->getTransport();
            $html = $transport->getMessage();
            $message = Message::fromString($html->getRawMessage());
            $bodyMessage = new \Zend\Mime\Part($message->getBody());
            $bodyMessage->type = 'text/html';
            $bodyMessage->charset = 'utf-8';
            $bodyPart = new \Zend\Mime\Message();
            $bodyPart->setParts([$bodyMessage, $attachPdf]);

            #transport email with body part
            $transport->getMessage()->setBodyHtml($bodyPart);
            $transport->sendMessage();
        } else {
            $this->attachPDF();
            parent::send();
        }
    }


texts: Extending Magento 2 Data Migration Tools

texts:
Magento 2 provides a separated module for data migration: magento/data-migration-tool.
During the migration, it needs to customize this module and implement some additional steps to port 3rd-party customizations. Right now, we have the following changes in the .gitignore file of the project:

  !/vendor/magento/data-migration-tool/etc/commerce-to-commerce/1.14.1.0/config.xml
  !/vendor/magento/data-migration-tool/etc/commerce-to-commerce/1.14.1.0/map.xml
  !/vendor/magento/data-migration-tool/etc/commerce-to-commerce/settings.xml
  !/vendor/magento/data-migration-tool/etc/commerce-to-commerce/map-sales.xml
  !vendor/magento/data-migration-tool/etc/commerce-to-commerce/eav-attribute-groups.xml
  !vendor/magento/data-migration-tool/src/Migration/Step/Claims/*

Is there any best practice how to extend this module? During magento porting, version of Magento 2 is being updating that's why the tool is being updated as well and it's important to save changes there.


texts: Setting up a 2nd Rackspace Cloud Server as slave dedicated db server in my cluster - 1 15GB slave or 2 8GB?

texts:
So as the title states, I am going to set up a second RackSpace cloud server as a slave DB on my Magento cluster.  Currently, I have one of their 15GB Performance 2 servers as my DB, but I would like to set up a slave for reads.   I just noticed that Magento can support more than just the 1 slave, so I am curious if it might offer more performance to set up 2 8GB Performance 1s  as the read slaves, with the existing 15GB Performance 2 as the write slave.  The financial cost is pretty much the same.

What do you think?  I am currently running Magento CE 1.8.  Thank you!


texts: Extension (M1) uploading problem - The "package.xml" file does not exist; please verify the archive

texts:
I'm trying to upload an extension (M1) to Magento Marketplace, but it keeps returning the following error:

  The "package.xml" file does not exist; please verify the archive.

I'm not sure what is causing the issue as the package.xml does exist in the root of the folder. To create a tar file, use the cvf command line option (tar -cvzf ...). What am I missing here? Also, is it required to fill out the contents section while compiling the extension package?


texts: Last logged in always never, not logging

texts: I turned on logging module, it works, but no logs in log_customer or log_visitor. Those tables are empty. What else can block logging? Magento 1.9


texts:
I have a simple code in Mangento and trying to change padding for li class current:

Page:

1

I have tried these two but nothing is working. What am I doing wrong?

li .current{margin-left:5px;margin-right:5px;margin-top:5px;}
.current li {margin-left:5px;margin-right:5px;margin-top:5px;}


texts:
How can i send a id from my form to a insert Listing grid?

What i want to do, is in my form i load a grid with insert Listing.

In this grid i want all results with id of the form.

<insertListing name="insertlisting_colors_one">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="autoRender" xsi:type="boolean">true</item>
                <item name="imports" xsi:type="array">
                    <item name="spd_id" xsi:type="string">${ $.provider }:data.spd_id</item>
                </item>
                <item name="ns" xsi:type="string">colors_one_grid</item>
            </item>
        </argument>
    </insertListing>

Below is the code in the grid

<item name="filter_url_params" xsi:type="array">
                    <item name="color_amount" xsi:type="string">1</item>

                    <item name="spd_id" xsi:type="string">${ $.parentName }.spd_id</item>
                </item>


texts: Get product ID on event controller_action_predispatch_checkout_cart_add

texts:
I'm using event controller_action_predispatch_checkout_cart_add which will be fired before adding product to cart. But in my observer function I'm not getting product id.

config:

  <events>
        <controller_action_predispatch_checkout_cart_add>
            <observers>
                <retailon_product_add_cart>
                    <type>singleton</type>
                    <class>retailon_productoption/observer</class>
                    <method>cartProductAddBefore</method>
                </retailon_product_add_cart>
            </observers>
        </controller_action_predispatch_checkout_cart_add>
    </events>

Observer function

    public function cartProductAddBefore(Varien_Event_Observer $observer){
        $product    = $observer->getEvent()->getProduct();
        $pId        = $product->getId();
        Mage::log('PID:'.$pId, null, 'oo.log');
    }

It says Fatal error: Call to a member function getId() .

I've also tried $observer->getProduct()->getId(); but no luck.


texts: How to the Magento 2 Success Message in Open Popup Box

texts: User Product Add to the cart after Success Message is Open to the Popup Box


texts:
I have just tried analysing my webshop: www.tekompagniet.dk using a chrome-extention, and it seems like a css and js minification would do a great job. However, I have troubles doing this without getting a lot of bugs.

I have tried fooman speedster before, but get some weird as looking pictures... any ideas?


texts: Magento 1.x: How to import store data but not configuration changes from prod to dev?

texts:
I'm working on a Magento site upgrade from 1.5 to 1.9. Currently, we have a development/staging site set up running 1.9, that originally had a complete copy of the production database.

However, obviously time has passed, and the customer data is out of sync from production. Additionally, we've made configuration changes to the dev site as a part of the 1.9 migration.

How do I go about transferring customer information (but not configuration information) from Production to Dev so that I can switch over by pointing DNS at the dev site?


texts:
The site i'm working on:  http://www.acuity-sports.com/

I've been tinkering around with the theme.css file and with the relative positions & the z-index as well.

I've been reading this page for advise
coding.smashingmagazine.com/2009/09/15/the-z-index-css-property-a-comprehensive-look/

However i'm trying to figure out what needs to be adjusted to fix the hidden mega menu on the site.   I swapped the top and bottom around here is the original theme

http://demo.magentech.com/#sm-sport

Any advice would rock :)


texts: new block for Customer Account - preferable inheritance

texts: I want to add custom block with custom logic to customer account. Is there any preferable inheritance in this case fro new block?


texts: Magento 2 custom tab on customer section in admin panel

texts:
I have created one custom tab section in customer dashboard area in back end.

In this section i have called one phtml file, in this phtml i want to load on js using magento x-init.

Please check below code.

<script type="text/x-magento-init">
    {
        "*": {
            "#magearray-attachments": {
                "magearrayFileUploadTwo": {
                }
            }
        }
    }
</script>

But, problem is js is not loading when i click on my custom tab "View Attachments". I have also assigned js in requirejs-config.js.

Can anyone help me with this?


texts: Is there a way to create a user who can only add but not edit/remove product in Magento?

texts:
I wonder whether there is a way to further restrict an magento website editor's role to the followings:

1) after login to magento, the editor is only able to add product to a certain category

2) the editor is not able to edit or remove existing products

3) the admin has to review all the products the editor added, before making products public.

Thanks!


texts: Magento 2 Widget Condition on edit not display

texts:
I am working on the Magento ver. 2.1.7 and added Widget Type Catalog Product List in the Home Page Block, with the condition

If ALL  of these conditions are TRUE :

Category  is  6

When I edited this widget again then condition Category  is  6  is not display but the result is display fine.

Please guide me.


texts: Magento 1: how to configure the first configuration which will be opened?

texts:
I noticed this behavior several times on several websites I've worked on.

When clicking System > Configuration the first configuration section that opens is not the first one of the list of tabs.

I've checked the sort order of the system.xml file of the module related to this section but didn't find anything obvious.

So I assume there may be some shady thing 3rd party modules vendors do to be sure their extension comes first when you open the configuration.

Where should I look at to investigate that behavior ?


texts: How to get all review filter/order by rating star of a product

texts:
$productId = $my_product->getId();

$reviews = Mage::getModel('review/review')->getResourceCollection()
          ->addStoreFilter(Mage::app()->getStore()->getId())
          ->addEntityFilter('product', $productId)
          ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
          ->setDateOrder()
          ->addRateVotes();

Using this get all review & rating but want to get most rating star reviews


texts: Best way to deploy from dev to production?

texts:
Currently using Magento 1 for my website and I needed to deploy a new "Build" onto my live server. For the past few months, I would zip the dev server files, FTP to live server. I would also export the SQL database and import them onto the production server.

With my most recent deployments, things get messy and I either end up needing to roll back the deployment or deal with what I have on the fly.

I'm trying to see if there is a better way of moving files from the dev server to Production.

I've looked into using a repository. While I have somewhat basic understanding of PHP, I'm not sure if using something like Git would benefit me. I've had to edit files before, but I mainly make my changes in the admin panel.

Any suggestions?


texts: Our website's using Magento 2 platform. Number of product and number of product's attributes keep growing faster.It leads to heavy loading when getting product's information(using EAV Model).In product detail page, we can optimize by indexing the product information to other server. But how can we optimize in checkout flow?. We cannot use flat product table because number of attribute is quite large(limited column in MYSQL table).


texts: Product attributes assigned to product, but not displaying on frontend when filtered in magento 2.3.2

texts:
The issue is i have assigned an attribute to a product , but it is not filterable on frontend.
For e.g i have assigned this attribute value https://prnt.sc/srkv28e to a product. However, on front end it shows no matching products found https://prnt.sc/srkw6d.
What is the issue. What is the setting i need to do in backend?


texts: How to insert a widget into created block factory block programmatically?

texts:
I've created a widget and a CMS block by using blockFactory class, like:

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $cmsBlockData = [
        'title' => 'Title',
        'identifier' => 'CMS block identifier',
        'content' => "CMS block content",
        'is_active' => 1,
        'stores' => [0],
        'sort_order' => 0
    ];
}

But this CMS block has to contain my created widget. I guess I need to specify that widget in my block, but not sure where. Could someone help me with that?

Besides that, what is the purpose of 'stores' => [0] setting?


texts: Varien_Data_Form - 'checkboxes' only save last value

texts:
I made a simple form field with checkboxes

            $form = new Varien_Data_Form();
            $form->setHtmlIdPrefix('option_');
            $form->setFieldNameSuffix('option');
            $this->setForm($form);

            $values = array(
                array(
                    label => 'check1',
                    value => 'check1'
                ),
                array(
                    label => 'check2',
                    value => 'check2'
                )
            );

            $fieldset = $form->addFieldset(
                'rules',
                array('legend' => 'Rules'
            );

            $fieldset->addField(
                'checks',
                'checkboxes',
                array(
                    'name'  => 'checks',
                    'values'=> $values,
                    'after_element_html' => '<button type="button" onclick="saveAndContinueEdit()">Save</button>'
               )
            );

but when I save them, only the last(in array) checked checkbox gets saved in the database.

In my install script I have

->addColumn(
    'checks',
    Varien_Db_Ddl_Table::TYPE_TEXT, '64k',
    array(),
    'Checkbox Test'
)

Why it's not working?


texts: Magento 2 get custom module data in theme phtml

texts:
I have created the custom module and inserted all the required fields detail in the database. Now, I want to list all rows in below file path:

I have tried with the $objectManager, but direct call $objectManager in phtml file is not correct way.

Before post this question I have go through the below answers, but when I run I getting a blank screen.

How can i get collection of custom module in magento 2

Magento 2 : How to get custom module collection in module template file

app\design\frontend\Vendor\Theme\Magento_Theme\templates\html/home_page.phtml

    <?php $collection = $block->getCustomoptionmanagerList();
        echo '
'; print_r($collection); die;
    ?>

 TOP

Model Class code file

app\code\Vendor\Customoptionmanager\Model/Customoptionmanager.php

<?php

namespace Vendor\Customoptionmanager\Model;

class Customoptionmanager extends \Magento\Framework\Model\AbstractModel
{
    protected function _construct()
    {
        $this->_init('Vendor\Customoptionmanager\Model\ResourceModel\Customoptionmanager');
    }
}

Block file Code:

<?php

use Vendor\Customoptionmanager\Model\CustomoptionmanagerFactory;
use Magento\Framework\Data\Collection;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;

class CustomoptionmanagerList extends Template
{
    protected $_modelCustomoptionmanagerFactory;

    public function __construct(Context $context,
            CustomoptionmanagerFactory $CustomoptionmanagerList,
            array $data = [])
        {
            $this->_modelCustomoptionmanagerFactory = $CustomoptionmanagerList;
           parent::__construct($context, $data);
        }

   public function getCustomoptionmanagerList()
   {
      $optionCollection = $this->_modelCustomoptionmanagerFactory->create()->getCollection();
       return $optionCollection;
   }
}
?>


texts: Magento 1.9 How to set session and clear session in login and logout

texts:
I would like to set session during login action and clear session during logout action.

By  googling I understand the following code will help setting the session and clearing the session.

Mage::getSingleton('customer/session')->setMyValue($myValue);
Mage::getSingleton('customer/session')->unsMyValue();

But I don't know what are the files and where exactly I need to include these code to set session during login and clear session during logout.

Please advice.


texts: Magento2: How can solve cache issue when do redirection to login page?

texts:
I am facing issue of cache. I have added condition if customer not logged then user will redirect to login page every time. but it is working only one time and when I clear cache then again it work.
please see my code below. I am using this code in footer.phtml file.

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$customerSession = $objectManager->get('\Magento\Customer\Model\Session');
    $urlInterface = $objectManager->get('\Magento\Framework\UrlInterface');
    if(!$customerSession->isLoggedIn()) {
        $customerSession->setAfterAuthUrl($urlInterface->getCurrentUrl());
        $customerSession->authenticate();
    }

Anyone have an idea for that? How can fix this. I can not disabled cache from admin for that. so I want other solution.


texts: PaymentIntent Error while creating order via Stripe via magneto REST API

texts:
I'm trying to create order using
POST /rest/V1/carts/mine/payment-information
with test info
{
    "paymentMethod": {
        "method": "stripe_payments",
        "additional_data": {
            "number": "4242424242424242",
            "exp_month": "10",
            "exp_year": "12",
            "cvv": "231"
        }
    }
}

but got error and I got in system logs
[2021-04-15 13:57:23] main.ERROR: Magento2 v2.5.7: You cannot confirm this PaymentIntent because it's missing a payment method. You can either update the PaymentIntent with a payment method and then confirm it again, or confirm it again directly with a payment method. [] []


texts: How to download Invoice without login Magento Admin?

texts: I need to get invoice without login Magento admin, is it possible using any CRM or API Services?


texts: Google analytics not working in payment success page in Magento 1.9.3.7

texts: i am using Magento 1.9.3.7 and here i have add a google analytics code using admin panel. It is working fine everywhere but payment successfull page. What things are going wrong ?


texts: Cannot overwrite product list template in catalog_category_view

texts:
I am trying to overwrite this template from a custom module but nothing at all is working. I've tried arguments to set the template... I've messed with sequence.

Below is the code in Vendor/Module/view/frontend/layout/catalog_category_view.xml

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="catalog_category_view"/>

    <body>
        <referenceBlock name="category.products">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Elcometer_Quote::product/list.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

This will not work, it is placed: app/code/Vendor/Module/view/frontend/layout

What am I doing wrong?


texts: How to copy Luma Layered Navigation to Blank Theme

texts:
I have created a custom theme in Magento 2.3 which is extended from the blank theme.

I would like to use the luma layered navigation.

I have copied Magento_LayeredNavigation folder from /vendor/magento/theme-frontend-luma to my theme path app/design/frontend/vendor/theme/ and ran the static content deploy.

I then receive the following error message:

  main.CRITICAL: variable @filter-quantity is undefined in file magento-install/var/view_preprocessed/pub/static/frontend/vendor/theme/en_GB/Magento_LayeredNavigation/css/source/_module.less in _module.less on line 105, column 29
  103|
  104|         &-value {
  105|             .lib-css(color, @filter-quantity);
  106|         }
  107|
  108|         &-options { {"exception":"[object] (Magento\Framework\View\Asset\ContentProcessorException(code: 0): variable @filter-quantity is undefined in file magento-install/var/view_preprocessed/pub/static/frontend/vendor/theme/en_GB/Magento_LayeredNavigation/css/source/_module.less in _module.less on line 105, column 29
  103|
  104|         &-value {
  105|             .lib-css(color, @filter-quantity);
  106|         }
  107|
  108|         &-options { at magento-install/vendor/magento/framework/Css/PreProcessor/Adapter/Less/Processor.php:97)"} []


texts: Magento Each New Invoice Increment Id Increment By 5?

texts:
I need to increment each new invoice id by 5, i have tried below code.

But changed all invoices, shipments, orders and credit memos.

I need each new invoice id increment by 5, shipments increment by 5 and credit memos increment by 3.

Also sales order increment by 1(normal).

How can i do this .?

Any one help me.

class Mage_Eav_Model_Entity_Increment_Numeric extends Mage_Eav_Model_Entity_Increment_Abstract
{
   public function getNextId()
    {
        $last = $this->getLastId();

        if (strpos($last, $this->getPrefix()) === 0) {
            $last = (int)substr($last, strlen($this->getPrefix()));
        } else {
            $last = (int)$last;
        }

        $next = $last + 5;

        return $this->format($next);
    }
}


texts: Magento - issues with recurring profiles and coupons

texts:
I have a subscription based site where we want to offer the first month for free using a coupon code. The problem is that when you place an order with the coupon code, Magento automatically applies that coupon (so to say) to every subsequent billing month.

Does anyone know which files would control this so that I can change this behavior?

Another solution may be to use the trial period feature, however this won't let you use 0 as a price and also charges tax on the full amount even if set to $0.01.

Any help or suggestions would be greatly appreciated!


texts: Delivery instructions do not appear on order confirmation email or at invoice

texts: When checking out the customer has the ability to add delivery instructions to their order on the checkout page (leave arrangement at door, recipient may be slow answering the door, call in case no one is home, etc.). However, on the order confirmation page I get this message does not appear.


texts:
Full-page cache is turned on (Magento EE ver 1.14.0.1). However, some products are having redirect loop upon hitting the URL. No error in the logs. If I clear the full_page_cache, then it would now work. I searched for the full_page_cache folder for the problematic URLs  and here's what I got (in a serialized form):

array (
  'cache_subprocessor' => 'Enterprise_PageCache_Model_Processor_Product',
  'current_product_id' => '400',
  'response_headers' =>
  array (
    0 =>
    array (
      'name' => 'Content-Type',
      'value' => 'text/html; charset=UTF-8',
      'replace' => false,
    ),
    1 =>
    array (
      'name' => 'X-Frame-Options',
      'value' => 'SAMEORIGIN',
      'replace' => true,
    ),
    2 =>
    array (
      'name' => 'P3p',
      'value' => 'CP="CAO PSA OUR"',
      'replace' => true,
    ),
    3 =>
    array (
      'name' => 'Location',
      'value' => 'http://www.example.com/this-is-the-product-url',
      'replace' => true,
    ),
  ),
  'routing_aliases' =>
  array (
    'rewrite_request_path' => 'this-is-the-product-url',
  ),
  'routing_requested_route' => 'catalog',
  'routing_requested_controller' => 'product',
  'routing_requested_action' => 'view',
  'sid_cookie_name' => 'frontend',
)

Other products don't have this:

   3 =>
    array (
      'name' => 'Location',
      'value' => 'http://www.example.com/this-is-the-product-url',
      'replace' => true,
    ),

If I clear the full page cache, it would not occur, thus, intermittent to random products. I couldn't replicate what the cause of redirect loop is. Any idea?


texts:
If my main crontab runs the magento cron.php every 30 mins and i have a cron job set in a modules config.xml to run every 15 mins.  Will that mean the modules cron gets run:

Once every 30 mins
Twice every 30 mins


texts: Extension Needed for Product Customization

texts:
I have been searching for an extension with the exact same function as this:
http://www.micro-scooters.co.uk/create-mini-micro/create-your-own-mini-micro-scooter.html

Unforunately, I couldn;t find in extensions section the same extension used in this website.
I know this is built with Magento Community edition.
Any ideas?

Thank you in advance.


texts: Varnish Cache Always Invalidate Every Second on API Update

texts:
Our Magento 2 are connected to third party API, and every time the there is API update the varnish are being purged.
The problem starts when there is 2-3 API request every second, that's mean varnish cache always empty.

Here is the deatils:

$ varnishlog -g request -q 'ReqMethod eq "PURGE"' -i 'ReqHeader'

The exact tags being cleared vary each request, but an example is:

  ReqHeader X-Magento-Tags-Pattern: ((^|,)catalog_product_9401(,|$))|((^|,)catalog_product_9397(,|$))|((^|,)catalog_category_2(,|$))|((^|,)catalog_category_6(,|$))|((^|,)catalog_category_10(,|$))|((^|,)catalog_category_52(,|$))|((^|,)catalog_category_121(,|$))|((^|,

If we compare this to the cache tags used by frontpage:

  BerespHeader X-Magento-Tags:
  store,cms_block,catalog_category,catalog_category_7,catalog_category_5,catalog_category_4,catalog_category_6,catalog_category_3,catalog_category_8,catalog_category_9,catalog_category_10,cms_block_NavigationSaleBanner,cms_page_2,cms_block_

Some categories that are used on the frontpage (eg catalog_category_10, catalog_category_6) are being continuously flushed by Magento.
Reviewing Magento's debug.log it looks like this cache invalidation is being forced by API calls to the site:

  [2019-02-04 07:41:44] report.DEBUG: cache_invalidate:
  {"method":"POST","url":"https://www.website.com.au/rest/V1/perennial/stprice","invalidateInfo":{"servers":["[object]
  (Zend\Uri\Uri:
  http://127.0.0.1:8000/)"],"tagsPattern":"((^|,)catalog_product_9521(,|$))|((^|,)catalog_product_8018(,|$))|((^|,)catalog_category_2(,|$))|((^|,)catalog_category_6(,|$))|((^|,)catalog_category_10(,|$))|((^|,)catalog_category_52(,|$))|((^|,)catalog_category_121(,|$))|((^|,)catalog_category_243(,|$))|((^|,)catalog_category_508(,|$))|((^|,)catalog_category_1(,|$))"},"is_exception":false}
  []

These API calls are coming from the IP address 123.51.107.62

  127.0.0.1 123.51.107.62, 162.158.2.110, 127.0.0.1 - [04/Feb/2019:02:43:48 -0500] "POST /rest/V1/perennial/stprice
  HTTP/1.1" 200 191 "-" "OpenEdge-HttpClient/0.4.0 (WIN32/64)
  OpenEdge/11.7.2.0.1497 Lib-ABLSockets/0.4.0"
  127.0.0.1 123.51.107.62, 162.158.2.158, 127.0.0.1 - [04/Feb/2019:02:43:50 -0500] "POST /rest/V1/perennial/stprice
  HTTP/1.1" 200 191 "-" "OpenEdge-HttpClient/0.4.0 (WIN32/64)
  OpenEdge/11.7.2.0.1497 Lib-ABLSockets/0.4.0"
  127.0.0.1 123.51.107.62, 162.158.2.158, 127.0.0.1 - [04/Feb/2019:02:43:53 -0500] "POST /rest/V1/perennial/stprice
  HTTP/1.1" 200 191 "-" "OpenEdge-HttpClient/0.4.0 (WIN32/64)
  OpenEdge/11.7.2.0.1497 Lib-ABLSockets/0.4.0"
  127.0.0.1 123.51.107.62, 162.158.2.170, 127.0.0.1 - [04/Feb/2019:02:43:59 -0500] "POST /rest/V1/perennial/stprice
  HTTP/1.1" 200 192 "-" "OpenEdge-HttpClient/0.4.0 (WIN32/64)
  OpenEdge/11.7.2.0.1497 Lib-ABLSockets/0.4.0"

These API calls are likely updating some aspect of the product/categories that causes Magento to force a cache invalidation. Additionally as the requests are coming in slowly (one every few seconds), the cache invalidation is re-triggered over and over -- ensuring Varnish can't cache the frontpage for longer than a few seconds.

Is there any way to modify Varnish VCL file (to work-around the constant purging)??

Thanks


texts: Magento 2: Magento Test Framework(MTF) Detail Document for custom module functional test

texts:
How to create the functional test for custom module in magento 2.
Magento team not given proper doc and not mentioned steps to create functional test for custom module.

Any body know in this world ?


texts:
I have a question regarding Magento upgrade.

I installed Magento 1.9.1.1 with n98-magerun and I have upgraded it to currently the latest version (1.9.2.1) via Downloader. Lets call this System A.

I also downloaded the latest version from Magento website. Lets call this System B.

When I compared the two Systems, I've noticed that the System B has a folder 'dev' with tests that is absent in System A.

What is the correct way to upgrade the System A, that I get the System B as a result?

Why does this inequality occur?


texts: Images not displaying in cart or mini cart

texts:
I seem to have lost my images from my cart page and also the mini cart at the top of the screen. When i go into a product and add to the cart then view the mini cart (hover over cart icon) then the image is displaying perfectly with the source

But then when i click on the cart to view the basket the image disappear and is replaced with the magento placeholder

The line that calls the product image says,

<img src="<?php echo $this->getProductThumbnail()->resize($imgX,$imgY); ?>" data-srcX2="<?php echo $this->getProductThumbnail()->resize($imgX*2,$imgY*2); ?>" width="<?php echo $imgX;?>" height="<?php echo $imgY;?>" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" />

which if i am correct should get the  product image thumbnail, resize it and display it?

Does anybody know what is going wrong here and why i am losing my image every time i refresh the page or click onto the cart page.

Thank you


texts: Magento2 - How to update configurable product price based on date selection with color, size etc attributes?

texts:
In Magento2 Configurable Product Page I want to update price based on attribute change like color, size etc. with custom field FROM DATE and TO DATE selection.

NOTE: (by default Magento provides with configurable options like size, color etc.).

I have attached the screen shot also :

When I change dates then changes should be done including to size and color based price too, but it responses with the addition of PRODUCT MAIN PRICE

How to solve this problem?


texts: Time attribute in code with custom coding

texts:
I created new attribute for products with time input in setup of my module, Setup code is here:

class Parseh_Course_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup {
     public function getDefaultEntities()   {
            return array(
              'catalog_product' => array(
                'entity_model'                   => 'catalog/product',
                'attribute_model'                => 'catalog/resource_eav_attribute',
                'table'                          => 'catalog/product',
                'additional_attribute_table'     => 'catalog/eav_attribute',
                'entity_attribute_collection'    => 'catalog/product_attribute_collection',
                'attributes'                     => array(
                  'course_end_time' => array(
                    'type'                       => 'varchar',
                    'label'                      => 'End Time',
                    'input'                      => 'time',
                    'backend'                    => 'parseh_course/course_attribute_backend_time',
                    'required'                   => true,
                    'user_defined'               => false,
                    'sort_order'                 => 4,
                    'global'                     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
                    'used_in_product_listing'    => true,
                    'visible_on_front'           => true,
                    'apply_to'                   => Parseh_Course_Model_Product_Type::TYPE_COURSE,
                    'group'                      => 'Scheduling',
                  ),

                )
              )
            );
      }
}

As you see I used "parseh_course/course_attribute_backend_time" model for this input backend.

class Parseh_Course_Model_Course_Attribute_Backend_Time extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract
{
  public function beforeSave($object) {
    $attributeCode = $this->getAttribute()->getName();
    $data = $object->getData($attributeCode);
    if (!is_array($data)) {
      $data = array();
    }
    $object->setData($attributeCode, join(':', $data));
    if (is_null($object->getData($attributeCode))) {
      $object->setData($attributeCode, false);
    }
  }

  public function afterLoad($object) {
    $attributeCode = $this->getAttribute()->getName();
    $data = $object->getData($attributeCode);
    if ($data) {
      $object->setData($attributeCode, explode(':', $data));
    }

    return $this;
  }
}

In beforeSave function I join hour, minute and seconds with ":" and make a string to save in database.
In afterLoad function the value of attribute loads correct same as "10:30:00" but when I explode it and create an array of data to fill time inputs in edit form of product, values of hour, minute, second inputs are 00.

Please help me!


texts: create date and time attribute for product in magento 2

texts:
I tried to create an attribute for product which has to be display date and time calender and that should be stored in database as date and time formate only.I struggled it for a lot but no luck.Can you please any one help me..
this is my script

$eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'xyz_start_time',
        [
        'group' => 'xyz',
        'type' => 'datetime',
        'backend' => '',
        'frontend' => '',
        'label' => 'Start Time',
        'input' => 'date',
        'class' => '',
        'source' => '',
        'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
        'visible' => true,
        'required' => false,
        'user_defined' => true,
        'default' => '',
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => false,
        'used_in_product_listing' => true,
        'unique' => false,
        'apply_to' => 'simple,configurable,virtual,bundle,downloadable'
        ]
        );

$eavSetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY,
    'xyz_end_time',
    [
    'group' => 'xyz',
    'type' => 'datetime',
    'backend' => '',
    'frontend' => '',
    'label' => 'End Time',
    'input' => 'date',
    'class' => '',
    'source' => '',
    'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'default' => '',
    'searchable' => false,
    'filterable' => false,
    'comparable' => false,
    'visible_on_front' => false,
    'used_in_product_listing' => true,
    'unique' => false,
    'apply_to' => 'simple,configurable,virtual,bundle,downloadable'
    ]
    );

It is creating datepicker with date only not showing time on it.


texts: Magento 2: add specific option for widget

texts:
I want to add specific widgets in admin panel , but I'd like to duplicate it.

for instance:

  app/code/my/module-links/etc/adminhtml/system.xml

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

                Menus/Links Settings
                <tab>my</tab>
                <resource>My_Links::config</resource>

                <group id="widget" translate="label" sortOrder="300" showInDefault="1" showInWebsite="1" showInStore="1">
                    Clone Model 2

                    <clone_model>My\Links\Model\Widget</clone_model>
                    <field id="status_4" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
                        Fourth Block Status
                        <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
                    </field>
                    <field id="title_4" translate="lable" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1">
                        Title
                    </field>
                    <field id="links_4" translate="label comment" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1">
                        Links
                        <frontend_model>My\Links\Block\Adminhtml\Form\Field\Footer</frontend_model>
                        <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                        <comment><![CDATA[
                        For using Internal Url (Link/url within website) just put keyword after url.

                        For ex.: for putting this url "http://example.com/contacts/" just insert "contacts" keyword

                        For external Link, Paste the whole link for ex. "https://www.troll.no"]]></comment>
                    </field>
                </group>

        </system>
    </config>

as we see I am using clone_model to duplicate the same widget. But in admin panel I see only one widget, but I need to see "Add widget" button after adding new widget(for clone).

Attaching screenshot.

Thanks for any advise and help.


texts: Refused to connect to because it violates the following Content Security Policy directive

texts:
My js code: -

const MODEL_PATH = 'http://s3-us-west-2.amazonaws.com/s.cdpn.io/1376484/stacy_lightweight.glb';

The console is throwing an error:

  Refused to connect to 'http://s3-us-west-2.amazonaws.com/s.cdpn.io/1376484/stacy_lightweight.glb' because it violates the following Content Security Policy directive: "connect-src geostag.cardinalcommerce.com geo.cardinalcommerce.com 1eafstag.cardinalcommerce.com 1eaf.cardinalcommerce.com centinelapistag.cardinalcommerce.com centinelapi.cardinalcommerce.com *.cardinalcommerce.com https://s3-us-west-2.amazonaws.com 'self' 'unsafe-inline'".


texts: Get categories and its sub categories REST APi

texts:
How to get subcategries for each category in REST API?

I tried to get category as:

https://domain.com/index.php/rest/V1/categories/:categoryID


texts: Magento 1.9 : Cookie restriction mode not working

texts:
I activated the cookie restriction mode in the backend & cleared all caches.

The CMS static block called "cookie_restriction_notice" is activated too.

But there is no overlay showing up.

I also wasn't able to find any other configuration options.

What am I missing?


texts: Magento 1.9: Change Grid/List View Based on Category

texts: My default view is List view, how can I change based on category.


texts: So i'm importing products from .csv file. The file I want to import is located here https://en.yournewstyle.pl/tresc/csv-files (it says it's configured for magento). Import goes fine, but all products are imported as configurable products. Is that import file fault or I just don't get it how to configure them right? From what I understand I need simple products linked to the configurable products is that right?


texts: How can i defined attributes for products which is already inside the website

texts: How can i defined attributes for the products which is already inside available in my website and also how to the removed duplicate products.


texts: Trigger modal after placing a product in minicart on Magento 2

texts:
I need to show a modal after a product is placed inside cart. This is what i have so far.

This is my default.xml

<body>
    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="minicart.lightwindow" template="Company_MiniCartLightWindow::minicart_lightWindow.phtml"/>
    </referenceContainer>
</body>

This is my template

    <div class="modal" id="add-to-cart-modal">
    Hello word.
    </div>
    <script type="text/x-magento-init">
    {
       "[data-block='minicart']" : {
       "Company_MiniCartLightWindow/js/view/minicart_lightwindow" : {}
        }
    }
</script>

finally this is my js file

    define(["jquery/ui","jquery"], function(Component, $){
       return function(config, element){
       var minicart = $(element);
       minicart.on('contentLoading', function () {
           minicart.on('contentUpdated', function () {
                    alert('hello');
           });
       });
     }
   });

Not even the alert is triggered after adding product to cart. No errors on js require on console either.

Thank You.


texts: Magento 2 Configurable product additional plus price showing - unsure where price is coming from

texts:
Got a strange scenario where getting plus prices showing in configurable dropdown.

These are simples associated to a configurable product.

Not seeing anywhere where these plus prices are defined. Reverted to default template just to make sure not templating issue.

Confirmed correct price coming through on basket.

These are not the configuration prices.

Where are these prices plus (+) prices coming from?


texts: magento export get real image url instead of cached image url

texts:
I want to get the products real image url instead of the cached one for my export script. Below is my code

<?php
error_reporting(E_ALL | E_STRICT);
define('MAGENTO_ROOT', getcwd());
$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
ini_set('display_errors', 1);
Mage::app();
$storeId = 15; //id store
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load($storeId));
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*');
$collection->addAttributeToFilter('status', 1);//attivo prodotto 1 o 0
$lines = array();
//parte stampo prima riga
$lines[] = array("Prodotto SKU","Nome Prodotto","Prezzo Prodotto","Prodotto URL","Descrizione Prodotto","Immagine URL","Categoria Prodotto");
//arreizzo tutti i dati sotto
foreach ($collection as $product) {
    $line = array();
    $line[] = $product->getName();//Nome Prodotto
    $line[] = 'dddd-->'.$product->getThumbnail();
    // Mage::helper('catalog/image')->init($product, 'image')->__toString(); //Immagine URL IN CACHE

    $categories = $product->getCategoryCollection();
    $categoryNames = array();
    foreach ($categories as $category) {
        $categoryNames[] = $category->getName();
    }
    $line[] = implode(' | ', $categoryNames); //Categoria Prodotto INFAME
    $lines[] = $line;
}

foreach ($lines as $line) {
    echo '"'.implode('","', $line).'"'."\n";
}


texts: Magento contacts forms with multiple transactional emails templates

texts:
I want to have more contacts forms in my store and separate transactional emails templates for each contact form in part, for example:

contact_form1.phtml with contact_form1.html email template;
contact_form2.phtml with contact_form2.html;
contact_form3.phtml with contact_form3.html;
....

I need to be like this because I want to have different variable in each email template.

I found this Inchoo tutorial but I don't know how I can add multiple forms and email templates.

Thank you in advance


texts:
I need the date of out of stock product.

is this possible we get the date of product when the product is out of stock or again quantity added in stock?

Thanks.


texts: Magento2 How to override PHP file vendor/magento/module-customer/Model/Vat.php in custom module ? VAT Validation Error

texts:
How Can I override this PHP file ?
vendor/magento/module-customer/Model/Vat.php
I want to change

const VAT_VALIDATION_WSDL_URL = 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService?wsdl';

to

const VAT_VALIDATION_WSDL_URL = 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl';

How Can I do this in my custom module ?


texts: Magento2 alternative to stream_content_create

texts:
I understand Magento2 has replaced various filesystem PHP functions with their own safer version in Magento\Framework\Filesystem\Driver\File.
For example get_file_contents should be called instead as $this->fileDriver->fileGetContents($url, false, $context)
Though am stuck on "stream_content_create" as there seems to be no alternative?
ie.with phpcs I get this error :
$context  = stream_context_create($options);
-------------------------------------------------------------------------------------------
 157 | WARNING | [ ] The use of function stream_context_create() is discouraged

does anybody know what the replacement should be?


texts: Magento 2 : Partial capture when payment method is authorize.net direct post and mode is always authorize only

texts:
Magento 2: I have two products in cart, one is Preorder allow and for another product Preorder not allow.

Preorder allowed product have 2 installments, I need to capture the 1st installment after place an order with out invoice, no need to capture for second product. Payment method is always authorize.net direct post and mode is always authorize only.


texts: I got Recently view product view in home page is it any script for sliding for recent view product? Please suggest some of the script for sliding product


texts:
I am trying to tranfer magento from server to localhost,
but it is giving

Fatal error: Call to a member function extend() on boolean in /var/www/html/mage/lib/Varien/Simplexml/Config.php on line 600

this error

local.xml file

 <?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Core
 * @copyright   Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
-->
<config>
    <global>
        <install>
            <date><![CDATA[Fri, 09 Jun 2017 09:16:23 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[5f2d5e63de2cea16e028b34496eb4a40]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[bs_]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[127.0.0.1]]></host>
                     <username><![CDATA[vinay]]></username>
                    <dbname><![CDATA[mage]]></dbname>
                    <password><![CDATA[PD9@wzmnhun31]]></password>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[files]]></session_save>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>


texts: Send email to customer on order update via rest API

texts:
I'm using /rest/V1/orders POST WebService to update an existing order. Is there any way to send an email to customer when the order is updated this way?
Thanks in advance !


texts:
I am installing theme ves fasony and getting below error:

  Fatal error: Cannot instantiate interface
  Magento\Framework\Url\RouteParamsPreprocessorInterface in
  C:\xampp\htdocs\magento2\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php
  on line 73

Help me to fix this


texts: Magento2 coding standard public interface

texts:
According to coding standard protected function should not be used, so i have changed from protected to public then,

I am getting this warning from coding standard,

  Warning: The use of public non-interface method in ACTION is discouraged.

The code is,

protected function _isAllowed()
{
    return $this->_authorization->isAllowed('frontname_namespace::orders');
}

I changed to

public function _isAllowed()
{
    return $this->_authorization->isAllowed('frontname_namespace::orders');
}

Anyone have any idea about this ..


texts: Magento 2: Sorting out of stock items in catalog page

texts:
I need to display out of stock products after products, that is in stock.
Can anyone help me with this?
As you can see on this picature  not available and Out of  Stock products is showing after available products. How i can realize it in Magento 2?


texts: How add text in custom theme header magento 2

texts:
<referenceContainer name="header.wrapper">
          <block class="Magento\Theme\Block\Html\Header" name="header.links" after="logo">
            <arguments>
                <argument name="block_id" xsi:type="string">custom_header_text</argument>
            </arguments>
          </block>
        </referenceContainer>

app/design/frontend/Sm/multe/Magento_Theme/layout/default.xml

i added in code in magento 2 but not showing in header


texts: How to truncate database table using n98-magerun2?

texts:
I am trying to truncate the database table using n98-magerun2 version 3.2.0 and having some difficulties.
I know there is a command with option to run an SQL query:
db:query Executes an SQL query on the database defined in env.php

I had a look at this blog entry, however, the result is a bit different: https://alanstorm.com/n98-magerun-database-commands/
Even simple SELECT is not working. When I run:
n98-magerun db:query "SELECT * FROM cms_page"

I get following error:

[Symfony\Component\Console\Exception\RuntimeException]
Too many arguments, expected arguments "command" "query".

Any help will be appricaited.


texts: I have product ID.. i need product name and url

texts:
I have this in my customer dashboard, so people can see and unsubscribe from product alerts:

<?PHP
$customer_id = Mage::getSingleton('customer/session')->getCustomer()->getId();
$customer_price_alerts = Mage::getModel('productalert/price')
         ->getCollection()
         ->addFieldToFilter('customer_id', $customer_id);
foreach ( $customer_price_alerts as $alert )
{
 echo $alert->getProductId();
}
    ?>

I can put some stuff in the echo to add unsubscribe link and more. The "more" is my problem. I can only echo the product ID... WHen i use echo $alert->getProductName(); or Url... it aint showing me stuff... just empty fields.

Can this be done? Else i need to know how to convert my product ID to a clickable link, so people can click and check what product is behind the ID (ugly... but better than nothing).

Thanks!


texts: Magento2: How to get attribute EAN and implement to search URL

texts:
I have simple script to display others sellers the same product on product page.
<?= /* @escapeNotVerified */ __('Total other sellers:') ?>
<a class="others-sellers"
                                   href="<?= /* @escapeNotVerified */ $this->getUrl('catalogsearch/result/?q=') ?>"
                                   title="<?= /* @escapeNotVerified */ $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>">
                                    <?= /* @escapeNotVerified */ __('17') ?>

Issue is related to code:
<a class="others-sellers"
                                       href="<?= /* @escapeNotVerified */ $this->getUrl('catalogsearch/result/?q=') ?>"

This PHP code generate for me link:
https://mywebsite.pl/catalogsearch/result/?q=/

To end URL I need also  get attribute EAN and add to URL.
https://mywebsite.pl/catalogsearch/result/?q=83748273423333/
Here I have code how to get EAN. But can anyone help how can i implement this into the code?
<?php $_productNameStripped = $block->stripTags($_product->getEan(), null, true); ?>
            <?php /* @escapeNotVerified */  echo $_helper->productAttribute($_product, $_product->getEan(), 'ean'); ?>


texts: Magento2: How to use block from another module in my custom module?

texts:
I've one third party extension which is adding addthis block on few pages.

I want to add addthis block on product page too.

<page layout="1column" xmlns:xsi="w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
          <referenceContainer name="content"> <block class="Magefan\Blog\Block\Social\AddThis" name="addthis.js.init.new" template="Magefan_Blog::addthis-js.phtml" after="product.info.details" /> </referenceContainer>
     </body>
</page>

So I'm thinking to use the same block from that third party module. I've added that block definition in catalog_product_view.xml file in my custom module. But its not working. Can anyone help me please?


texts:
I am new to Magento and trying to create a module in Magento 1.9 by referring to perifay. After copying the code from perifay for controller output is not showing in the browser. I don't know what is wrong maybe URL ,i am getting 404 page every time below is the link and code of perifay

  https://www.pierrefay.com/magento-training/create-a-controller-tutorial.html


texts: Magento2 add custom buttonevent in admin edit form

texts:
can anyone help me with suggestions as to how we can add our own custom button with new custom event(saveandaddnew) like saveandcontinue in admin edit form?

$this->buttonList->add(
                'saveandcontinue',
                [
                    'label' => __('Save and Continue Edit'),
                    'class' => 'save',
                    'data_attribute' => [
                        'mage-init' => [
                            'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],
                        ],
                    ]
                ],


texts: How to add category id css class on body [Magento2]

texts:
I am trying to add a category id to css class on body tag but not able to find any way to do that.

With that category id on body class I can use different images for each category breadcrumbs using css.

At this moment I can't use default Magento 2 body classes because my website is multi language.

That example how than need to looks like.

<body class="current-category-id">


texts: How can I make the logo a link to the home page?

texts: I cant find the option to make it possible to click on my site's logo and direct myself to the homepage.


texts: Magento 2 custom module Collection join table _initSelect

texts:
My Collection.php

 ....
public function __construct(
                \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
                \Psr\Log\LoggerInterface $logger,
                \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
                \Magento\Framework\Event\ManagerInterface $eventManager,
                \Magento\Store\Model\StoreManagerInterface $storeManager,
                \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
                \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
            ) {
                $this->_init(
                    'Module\Vendor\Model\Test',
                    'Module\Vendor\Model\ResourceModel\Test'
                );
                parent::__construct(
                    $entityFactory, $logger, $fetchStrategy, $eventManager, $connection,
                    $resource
                );
                $this->logger = $logger;
                $this->storeManager = $storeManager;
                $this->store = $this->storeManager->getStore();
                $this->storeId = $this->store->getId();
                print_r($this->storeId);//THIS PRINTS ON THE PAGE CORRECT STORE ID
            }

            protected function _initSelect()
            {

                parent::_initSelect();
                $this->getSelect()->joinLeft(
                    ['secondTable' => $this->getTable('my_custom')], //2nd table name by which you want to join
                    'main_table.my_id = secondTable.my_id AND secondTable.store = '.(int)$this->storeId, // HERE DOES NOT WORK! common column which available in both table
                    '*' // '*' define that you want all column of 2nd table. if you want some particular column then you can define as ['column1','column2']
                );

            }
         ....

I printing The correct store ID Which is 1 in constructor but in _initSelect  Does not seem to work/Available if hard coded secondTable.store =1' Then it works.

I don't understand Why Anyone know What could be the reason?

Appreciate!


texts: Magento 2 - None of transactional emails are sending

texts:
None of store's transactional emails are sending (order confirmation, newsletter signup confirmation, account password reset etc).

All settings in backend of magento are good (like "Disable email communication"), all store emails are set.

Cron seems to be working. Here is the rules I got:

*   *   *   *   *   /usr/local/bin/php /home/uspatriot/public_html/bin/magento setup:cron:run >> /home/uspatriot/public_html/var/log/setup.cron.log

*   *   *   *   *   /usr/local/bin/php /home/uspatriot/public_html/update/cron.php >> /home/uspatriot/public_html/var/log/update.cron.log

*   *   *   *   *   /usr/local/bin/php /home/uspatriot/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/uspatriot/public_html/var/log/magento.cron.log

Here is the screenshot of DB:

I am not aware of any 3rd party modules, which would mess with emails either. Here is the screenshot:

I tried to use php mail function from ssh to see if that's the problem, like this:

mail -s testingmail testing@gmail.com
testing message

Nothing happens there.

Tried to do

mail -v to@address.com -- -r "from@address.com"

It returns error that gmail thinks it's spam and therefore blocked the email.

Tried to create php file with simple php mail() function in it, and then run with

php filename.php

It returns that email has been sent, yet nothing is actually happening.

I'm pooped. HELP! :)

UPDATE:

There are bunch of errors like this in update.log:
[2017-04-21 03:31:02] update-cron.ERROR: Cron readiness check failure! Found non-writable paths: /home/uspatriot/public_html/php.ini.sample [] []
i don't know if that is the problem. Tried to google - not much info on it.

UPDATE 2:

Got this from server support folks:

*It appears the PHP Mail function is enabled and working properly on the server at this time. I did a quick check for the function to insure it was enabled and then sent a test message manually via command line to my gmail account. I received this within the exim_maillog after that test:
This log shows the sending of the message through the PHP Mailer to my test gmail account:

2017-04-20 23:08:18 cwd=/root 4 args: send-mail -i -- lwtestingbodonald@gmail.com
2017-04-20 23:08:18 1d1Ovi-000NzU-4X <= root@liquid.regexseo.com U=root P=local S=556 T="Iron Maiden" for lwtestingbodonald@gmail.com
2017-04-20 23:08:18 1d1Ovi-000NzU-4X ** lwtestingbodonald@gmail.com R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [74.125.126.27] X=TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128 CV=yes:

However gmail did deny the message at their SMTP server due to the message being sent from root and gmail believes it to be a spam message.
SMTP error from remote mail server after end of data:

550-5.7.1 [67.225.162.240] The IP address sending this message does not have a\n550-5.7.1 PTR record setup. As a policy, Gmail does not accept messages from\n550-5.7.1 IPs with missing PTR records. Please visit\n550-5.7.1  https://support.google.com/mail/answer/81126#authentication for more\n550 5.7.1 information. l130si775055ita.29 - gsmtp

In conclusion to the original inquiry, all of this indicates that the PHP Mail function is active and working on the server. If you could give us some steps in order to replicate the issue you are encountering we will be able to better investigate. *


texts:
I'm curious about the purpose of a payment.xml and the controls it provides for a specific payment method. Also, I have seen different tags in one of the payment.xml from the vendor.
<?xml version="1.0"?>

<payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd">
    <credit_cards>
        <type id="SM" order="60">
            Switch/Maestro
        </type>
        <type id="SO" order="61">
            Solo
        </type>
    </credit_cards>
    <groups>
        <group id="paypal">
            PayPal
        </group>
    </groups>
    <methods>
        <method name="paypal_direct">
            <allow_multiple_address>1</allow_multiple_address>
        </method>
        <method name="paypal_billing_agreement">
            <allow_multiple_address>1</allow_multiple_address>
        </method>
    </methods>
</payment>

I would appreciate your thoughts on this. Thanks


texts: Magento 2.2.2 order refund REST API Before Plugin get item order to refund

texts:
Vendor\Module\Plugin\Order\Plugin.php:

namespace Vendor\Module\Plugin\Order;

class Refund
{

    /**
     * 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
     * @return int
     * @since 100.1.3
     */
    public function beforeExecute ($items) {
        print_r(get_class_methods($items));die;
    }

}

Vendor\Module\etc\di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Sales\Api\RefundOrderInterface">
        <plugin name="order-refund-checks" sortOrder="1"  disabled="false" type="Vendor\Module\Plugin\Order\Refund" />
    </type>
</config>

Using postman for testing:

POST http://dev.test/rest/V1/order/1/refund

Body JSON:

{
    "items": [
        {
            "extension_attributes": {},
            "order_item_id": 1,
            "qty": 1
        }
    ],
    "isOnline": false,
    "notify": true,
    "appendComment": true,
    "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": [
                1
            ]
        }
    }
}

RESPONSE:

Array
(
[0] => __construct
[1] => execute
[2] => ___init
[3] => ___callParent
[4] => __sleep
[5] => __wakeup
)

Screen Shot attached:

Any idea what should I do next? suggestions etc... thx.


texts: Check if 2 dates already exist in collection filtering

texts:
i have a custom collection which has database column start_at and end_at in Y-m-d format , i try to do some validation before inserting to database, one of them is make sure the period between start_at and end_at is not exist in database or the new start_at and end_at is not overlapping with existing start_at and end_at period. for example:

      Database Records
+-------------+------------+
|  start_at   |   end_at   |
+-------------+------------+
| 2018-10-10  | 2018-10-15 |
| 2018-10-17  | 2018-10-21 |
| 2018-10-22  | 2018-10-25 |
| 2018-11-02  | 2018-11-09 |
+--------------------------+

//wrong validation list
$startAt[1] = '2018-10-13';$endAt[1] = '2018-10-18';
$startAt[2] = '2018-10-24':$endAt[2] = '2018-10-26';
$startAt[3] = '2018-10-27';$endAt[3] = '2018-11-06';

//right validation list
$startAt[1] = '2018-10-16';$endAt[1] = '2018-10-16';
$startAt[2] = '2018-10-26':$endAt[2] = '2018-10-28';
$startAt[3] = '2018-10-30';$endAt[3] = '2018-11-01';

how can i filter the data above using collection filtering, so i can achieve the right filter method, what i've done so far but not working:

using and filter:

$now = new \DateTime();

//always return 0
$alreadyExistStart = $this->promo->create()->getCollection()
  ->addFieldToFilter('start_at', ['start_at' => $now->format($data['start_at'])])
  ->addFieldToFilter('end_at', ['end_at' => $now->format($data['start_at'])])
  ->count();

//always return 0
$alreadyExistEnd = $this->promo->create()->getCollection()
  ->addFieldToFilter('start_at', ['start_at' => $now->format($data['end_at'])])
  ->addFieldToFilter('end_at', ['end_at' => $now->format($data['end_at'])])
  ->count();

using or filter:

  //always return 0
  $alreadyExistEnd = $this->promo->create()->getCollection()
  ->addFieldToFilter(
        ['start_at', 'end_at'],
        [['gteq' => $data['end_at']], ['lteq' => $data['end_at']]]
  )->count();

  //always return 0
  $alreadyExistEnd = $this->promo->create()->getCollection()
  ->addFieldToFilter(
        ['start_at', 'end_at'],
        [['gteq' => $data['end_at']], ['lteq' => $data['end_at']]]
  )->count();


texts: How to configure a new Instance for an existing Database

texts:
I'm having a bit of trouble trying to get Magento to play nice inside a Docker container. Here's my situation:

I'm using Magento2 (1.0.0-beta)
I've already provisioned a MySQL database with Magento's sample data and configuration using the CLI's setup:install
Running setup:install inside a Docker at provision time successfully sets up Magento2 but overwrites the database

The question I have is how does one provision a new Magento machine from a fresh install but using an existing database and configuration? Are there specific files I need to copy off a master instance? And what is the best way to install all the cache files that setup:install does and warming everything up without mangling the shared database?


texts: Magento2 How to add column in sales order item renderer in admin order view

texts:
I have two custom fields in sales_order_item table. Now i want to show that two fields in sales order item section. I tried this solution. But it is always adding new column at the end.

So, how i can add my custom column after Item status and also should be editable? Like attached example.


texts: How to add custom value prefix in order and invoice number

texts:
I like to add prefix in order and invoice number and next number should be in current year and last 4 digit is Increment number, this are all without extension.

Example: 0001 to CCC-yy0001


texts: how to reorder the payment methods on front end?

texts:
In the payment method section I have three options and are in the following order..
1.checkout with credit card
2.Payment with amazon
3.Pay with paypal
And this method is getting rendered by the following code..

<?php if(!$this->hasError()): ?>

    <?php foreach ($this->getMethods('methods') as $method): ?>
        <?php $methodHtml = $this->getMethodHtml($method); ?>
        <?php if ($methodHtml): ?>

<?php echo $methodHtml; ?>

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

<?php endif; ?>

But I want to reorder it like :

Pay with paypal
Payment with amazon
Checkout with credit card
Could any one suggest how to reorder the payment method in the front end ?


texts: How to add Item Status to order confirmation email Magento 2.3.1

texts:
Is there a way to add the Item status (Ordered/Backordered) to the order confirmation email?
I tried below code.

    <?php if ($_item->getQtyBackordered()): ?>

<?php echo $_item->getQtyBackordered()*1 ?> Backordered.

    <?php endif; ?>

It displayed below value:

But it should be ordered and backordered.
https://prnt.sc/wr9jez


texts: Magento2.3.5 Dynamic Row Add New Column Removes Current Fields

texts:
I've added 4 dynamic row while back ref:https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/dynamic-row-system-config.html
Now I've added a 5th column but all the row data that was previously there disappeared!
I can see the data in the database but when the new field is added instead of magento just ignoring if is empty or not set it just won't render.
in _prepareToRender method I have.
protected function _prepareToRender()
    {
        $this->addColumn('from_qty', ['label' => __('From'), 'class' => 'required-entry']);
        $this->addColumn('to_qty', ['label' => __('To'), 'class' => 'required-entry']);
        $this->addColumn('price', ['label' => __('Price'), 'class' => 'required-entry']);
        //$this->addColumn('title', ['label' => __('Title'));
        $this->_addAfter = false;
        $this->_addButtonLabel = __('Add');
    }

above commented out I'm adding a new field called title but the precious rows that was saved when the new field is added it doesn't render in the backend.
any ideas how to go about that?
Thanks


texts: Magento 2 : Error While Adding Configuration Product From Listing Page

texts:
How to add configurable product to cart from product listing page?

Normal products are added but while trying for configurable product geeting error.

attribute is bind after checkout url so once page is loaded getting error for page not found. But product is added to cart. Url become like: checkoout/#size=168&color=50


texts: Magento 2 Magnifier using set the zoom product image at mobile device

texts:
I want to magnifier enable at the product details page using this way. but there magnifier enable at the desktop device.

 <var name="magnifier">
        <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
        <var name="top"></var> <!-- Top position of magnifier -->
        <var name="left"></var> <!-- Left position of magnifier -->
        <var name="width"></var> <!-- Width of magnifier block -->
        <var name="height"></var> <!-- Height of magnifier block -->
        <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
        <var name="enabled">false</var> <!-- Turn on/off magnifier (true/false) -->
        <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
  </var>

Actually i want to enable magnifier at the mobile device.


texts:
I'm having an issue with updating the price on custom options. The code that I'm using is

$options = $product->getProductOptionsCollection();
foreach( $options as $option ){
    $values = $option->getValuesCollection();
    foreach( $values as $value ){
        $value->setTitle("test")
        ->setSku("testsku")
        ->setPrice(23.00);
        $value->save();
    }
}
$product->save();

Right now I'm just using this as a test. The strange thing is that the sku, the title and other options like sort order that I had in there before would save fine, but the price will not. Do I need to do something specific for the price to save? Why would everything else update, but the price wont? Thanks for your help.


texts: Magento 2 Export all coupon codes in the XML format

texts:
Like sitemaps, I wanted to export/ get all active coupon code/ cart rule in XML format.

Please guide me how to do it?


texts:
I'm working with a copy of Magento 1.4EE which has Extendware FPC installed. I'm trying to get breadcrumbs working properly for products that are within more than one category. This is my first time working with Extendware, and I've worked out how the hole punching works for my breadcrumbs block, but it seems that hole punching only applies to the secondary cache, yet the site only uses the primary cache when a user is not logged in.

My question is how can I hole-punch or make sure that my breadcrumbs are always dynamic, even when the user is not logged in?

Help appreciated!


texts: How to add best sellers block in home page in magento 2.0?

texts: How to add best sellers block in home page using magento 2.0???Anyone Know it Please help me..


texts: Magento1 specific shipping display specific payment option

texts:
I want to show specific payment method when specific shipping is selected

Already Implement this solution but not works for me

code update in

  app\design\frontend\base\default\template\checkout\onepage\payment\methods.phtml

<?php
    $methods = $this->getMethods();
    $oneMethod = count($methods) <= 1;
?>
<?php if (empty($methods)): ?>
    <dt>
        <?php echo $this->__('No Payment Methods') ?>
    </dt>
<?php else:
    foreach ($methods as $_method):
     echo  $_code = $_method->getCode();

if($_POST['shipping_method'] == 'flatrate_flatrate') {
    if($_code == 'checkmo') {
        continue;
    }
}

?>

https://stackoverflow.com/questions/26604267/magento-onepage-checkout-hide-payment-method-depending-on-shipping-method


texts: New url and server for a Magento web application

texts:
I use same magento application and database (like copy and paste) on another server(eg. a development server). It seens like a succeed implementing to the new server, but possibly because I have hardcoded

 <reference name="head">
 <action method="addLinkRel">
 <rel>canonical</rel>
 <href>www.oldsite.com</href>
 </action>
 </reference>

in the home page layout xml, not matter which url I use, it will redirect to the old site (eg. oldsite.com) like 127.0.0.1/newsite redirects to oldsite.com, 127.0.0.1/newsite/admin to oldsite.com/admin.I have changed both basic urls in database to 127.0.0.1/newsite, but nothing help. Could it be the canonical link or something else? If it is canonicall link , how can I change it, when I cannot login to the admin?


texts: How to get grandtotal (refunding amount) in credit memo transactional email

texts: How can we include a variable in credit memo transactional emails in magento for including total amount refunded while generating credit memo?


texts: Products not displayed uniformly in list page

texts: In product list page I have set the column count for the products as 4. But the products are displayed as 3 in first column and 4 in next cloumn when there are seven products totally.Normally it should be displayed as 4 in first column and rest in the next column. I tried changing the styles for that. But am stuck here. Unable to figure out the reason.


texts: How to set/change a Product's Store View?

texts:
Magento 2.1.2. I have set up a test installation, with four sites, each with one Store and View (and corresponding root Category). I have previously successfully added products, set their categories, and they appear on the front end where expected.

But now I notice that as I add a new Product it acquires a Store View setting that's not the one I want, and there's no way to change it. After first save, when I edit the Product, there's a Store View switcher control at the top left, but it only offers the store view that the product is already configured for, and not the other three.

How is this supposed to work? Why is there no way to select a Store View scope when you first create the product? (As noted here: http://docs.magento.com/m2/ce/user_guide/catalog/product-workspace.html). If you have to go back to edit the scope, then why doesn't it offer other scopes? Have I hit a bug?


texts: Manageable approach to critical CSS in Magento 2

texts:
I'm working on using the critical CSS feature now available in M2 currently, but a little uncomfortable with the implementations I've seen, and wondering if anyone has developed a reliable approach which would be configured into a deployment pipeline? The approaches I've seen so far involve using e.g Penthouse to scrape a live site to grab critical CSS from key pages. I'd thought that, while Penthouse etc could be instructive as to what's critical, manually defining a subset of Less partials which compile to the critical.css file would be perhaps a more solid approach, however, this could be misunderstanding how the process works! This is the road I'm going down but would be interested in any pitfalls experienced by other devs in their implementations.
Work in progress being e.g
-- web/css/source/critical
Subset of global styles deemed to be critical, so e.g header, branding, typography etc (plus product/category critical styles as required)
-- This subset is compiled to the critical CSS file
Therefore, no scraping involved other than to help potentially inform what needs to go in this subset of Less files.
Appreciate this may be a little bit open for a SE post, so happy to retract it if so.


texts: Basic template question: Combine several products on one page?

texts:
I am currently trying to decide whether Magento would be a good system for our new (planned) webshop. What I am looking for is better insight into how I can influence the display of products.

My understanding is that Magento uses templates which basically combine php and html. I know about grid and list views when selecting categories of products. I am not familiar with the details of the templating language, e.g. includes, hierarchical of building blocks structures etc.

What I would like to know is if (and how) I can for example display two or more products side by side on one page. My database query will result in very few selected products and I would like to show them all (in more detail than grid/list view provides) on one page, maybe with a comparision table etc.

So basically my question is, if I can throw a list of products (an array?) to a template, and the template uses standardized building blocks (includes?) for each product?


texts: Magento2: New with magento cloud. How to run the commands on cloud environment

texts:
I have cloned the git on my local system, Now how to run the commands for cloud site. How to do this?

As I have CLI for this, But I don't know how I can use this?

Please suggest me for the same.

Thanks


texts: How to check if product is created from SOAP

texts: I am using 3rd party Inventory System (I can not modify). The products are saved from this 3rd party system to Magento. I would like to perform some actions on product before it gets saved from this system. How would I?


texts: how to grant permission to back up from the dashboard

texts:
I'm having difficulties in performing a sql backup through the Magento panel, after confirming the system informs me that I need permission to restore baxkup
I am logged in as a system administrator
I appreciate being able to help me solve this problem.


texts: Customizing interface of multiselect in magento

texts:
My  multi select list is very large, it is difficult to find out which options are selected, I want to change it into some thing like following, is it possible?
It can be any where, but currently I have a custom "customer_address" attribute type "multiselect",

I am creating my attribute like this my sql script,

    <?php

$installer = $this;

$installer->startSetup();

$installer->addAttribute('customer_address', 'additional_managers', array(
    'label' => 'Additional Store/Site Managers',
    'visible' => true,
    'required' => false,
    'type' => 'varchar',
    'input' => 'multiselect',
    'source' => 'abc_districtmanager/address_attribute_source_districtmanager',
    'onclick' => 'getSelectValues(this)',
    'user_defined' => 1,
    'position' => 100
));

$used_in_forms = array(
     'adminhtml_customer_address',
     'customer_address_edit',
     'customer_register_address'
    );

$attribute = Mage::getSingleton('eav/config')->getAttribute('customer_address', 'additional_managers');
$attribute->setData('used_in_forms', $used_in_forms);
$attribute->save();

$installer->endSetup();


texts: Remove cms block from only cms home page

texts:
I have created a cms block and using widget added inside header page container, now I want to remove that block from only home page.

How can i achieve this?

Widget screenshot to display block


texts: Magento2.3 : How do I programmatically submit a form generated via a UIComponent?

texts:
I created a UI Component form, but I am unable to find the  element in the source.

I would like to click a button and then inspect a field in the form and dependent on what value is selected submit the form to a specific url.

In my uiComponent I have,

 <argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="component" xsi:type="string">Vendor_Module/js/ui/form/new_form</item>
    </item>

Then I have the following code in Vendor_Module/js/ui/form/new_form:

define(
[
    'jquery',
    'Magento_Ui/js/form/form',
    'mage/url'
],
function ($, form, url) {
    'use strict';

    return form.extend({
        initialize: function () {
            this._super();

            $('#new_button').click(this.new_button);

            return this;
        },
        new_button: function (redirect, data) {
            this.validate();

            if (!this.additionalInvalid && !this.source.get('params.invalid')) {

                // CUSTOM CODE HERE BEFORE SUBMIT

                this.setAdditionalData(data)
                    .submit(redirect);
            } else {
                this.focusInvalid();
            }
        }

I am currently getting,

  Uncaught TypeError: this.validate is not a function


texts: How to Create Custom Variables inside WYSIWYG editor in Magento 2?

texts:
I have created a Custom field under Stores->Configuration->General.
I need to use that field as Custom variable inside WYSIWYG editor when Insert Variable option is clicked.

I don't Know how to proceed forward after creating those fields..Please Help me out..

Thanks in advance.


texts: Payment responce works on test mode but not live mode

texts: We are using Magento 1.9 with a realex payments plugin, at first we had our response page set to oursite.com/realex/response and this worked fine without ssl installed both in test mode and live mode, as soon as we installed the ssl from lets encrypt it fails, the payments go through but the response fails! Yesterday we changed the response url to  oursite.com/index.php/realex/response and it worked with the ssl on for the first time, but it still fails when live, we get the 3d secure process screen, the payment goes through but the response always fails. I hope somebody can help its driving me mad getting passed between the host, realex and the plugin developers.


texts: Get the base URL in Magento system.xml file in comment tag

texts:
In the below <comment>
 tag,
It's not redirecting to the correct page..

<allowedmethods translate="label">
   Allowed Methods
   <frontend_type>multiselect</frontend_type>
   <sort_order>30</sort_order>
   <source_model>ultimate_shipper/resource_method_collection</source_model>
   <show_in_default>1</show_in_default>
   <show_in_website>1</show_in_website>
   <show_in_store>0</show_in_store>
   <can_be_empty>1</can_be_empty>
   <comment><![CDATA[Add Custom Method. Example Comment.]]></comment>
</allowedmethods>

What I need is like this,

Add Custom Method

or

Add Custom Method

In front-end...

For that, What can I put in the system.xml?

For example:
<comment><![CDATA[Add Custom Method. Example Comment.]]></comment>

From: https://stackoverflow.com/questions/7686457/how-to-set-link-is-magegetbaseurl-for-breadcrumbs-in-layout/14576428#14576428


texts: what is the does the preference tag for di.xml do

texts:
I was wondering what is the purpose preference tag and the use for the tag in magento?

<preference for="Magento\Framework\App\Config\Storage\WriterInterface" type="Magento\Framework\App\Config\Storage\Writer" />


texts: Working with Old Price & Special Price in Magento 2

texts:
Im wanting to replicate this pricing look in Magento 2.

This is the code I used in our magento 1 to accomplish this.

            <?php $special_price = $_product->getSpecialPrice(); $regular_price = $_product->getPrice(); ?>
            <?php $saved_amount = $regular_price - $special_price; $saved_percent = 100 * $saved_amount / $regular_price; ?>
        Save: <?php echo '$'.number_format($saved_amount,0).' ('.number_format($saved_percent,0).'%)'; ?>

I am looking to put the equivalent of this in Magento 2.2.5. Magento 2 is using the code below to get pricing. I have been editing /Magento_Catalog/templates/product/price/final_price.phtml and noticed that M2 handles it differently and I have had no luck coming up with how to do this.

<?php if ($block->hasSpecialPrice()): ?>

        <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [
            'display_label'     => __('Regular Price'),
            'price_id'          => $block->getPriceId('old-price-' . $idSuffix),
            'price_type'        => 'oldPrice',
            'include_container' => true,
            'skip_adjustments'  => true
        ]); ?>

        <?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getAmount(), [
            'display_label'     => __('Special Price'),
            'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
            'price_type'        => 'finalPrice',
            'include_container' => true,
            'schema' => $schema
        ]); ?>
<?php else: ?>
    <?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getAmount(), [
        'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
        'price_type'        => 'finalPrice',
        'include_container' => true,
        'schema' => $schema
    ]); ?>
<?php endif; ?>

How can I accomplish this in the final_price.phtml to reflect how I have it in working in Magento 1?


texts: Magento 2 get current store currency code

texts:
In Magento 2 I have tried to get the current store code by the below-mentioned code line. But it returns an empty string.

$this->_storeManager->getStore()->getBaseCurrencyCode();


texts: custom_attributes not returning from Magento 2 REST API

texts:
Using the Magento 2 REST API, I was able to successfully create a new product attribute sending a PUT request to V1/products/attributes/{attribute_code}. In the request, I added a value in the custom_attributes object. However, when I got the attribute I created using a GET request to the same endpoint, I noticed the custom_attributes section was not returned. I can't seem to find any endpoint that will return that data. Could someone point me in the right direction? I'm very new to Magento development. If it helps, here's the JSON I used for the PUT request:
{
  "attribute": {
    "extension_attributes": {
      "is_pagebuilder_enabled": true
    },
  "is_wysiwyg_enabled": false,
  "is_html_allowed_on_front": true,
  "used_for_sort_by": false,
  "is_filterable": true,
  "is_filterable_in_search": true,
  "is_used_in_grid": false,
  "is_visible_in_grid": true,
  "is_filterable_in_grid": false,
  "position": 0,
  "apply_to": [],
  "is_searchable": "0",
  "is_visible_in_advanced_search": "0",
  "is_comparable": "1",
  "is_used_for_promo_rules": "0",
  "is_visible_on_front": "1",
  "used_in_product_listing": "1",
  "is_visible": true,
  "scope": "store",
  "frontend_input": "text",
  "entity_type_id": "4",
  "is_required": false,
    "options": [],
    "is_user_defined": true,
    "default_frontend_label": "string",
    "frontend_labels": [
      {
        "store_id": 0,
        "label": "string"
      }
    ],
  "is_user_defined": true,
  "default_frontend_label": "testing",
  "frontend_labels": [],
  "backend_type": "varchar",
  "backend_model": "Magento\\Eav\\Model\\Entity\\Attribute\\Backend\\ArrayBackend",
  "default_value": "",
  "is_unique": "0",
  "validation_rules": [],
    "custom_attributes": [
      {
        "attribute_code": "test-attr",
        "value": "true"
      }
    ]
  }
}


texts:
Hi  I tried to add captcha to subscribe.phtml
Here is my xml file.

    <default>
    <reference name="newsletter">
            <block type="captcha/captcha" name="captcha">
                <reference name="head">
                    <action method="addJs">
                        <file>mage/captcha.js</file>
                    </action>
                </reference>
                <action method="setFormId">
                    <formId>newsletter_subscribe</formId>
                </action>
                <action method="setImgWidth">
                    <width>230</width>
                </action>
                <action method="setImgHeight">
                    <width>50</width>
                </action>
            </block>
    </reference>
</default>


texts:
On product page I've a custom text field and I want to save it to order's comment section, if it is filled and order placed for that user.

I can either use sales_order_status_history_save_after or sales_order_place_after event to add comment to an order. How I can manage the session of the entered text ? Will it be fine to set session of the entered text in my controller using Mage::getSingleton('core/session')->setOrderComment($text); and observe it in sales_order_status_history_save_after and update order?

All I wanted to make sure is this comment goes for the particular product and customer who has entered this text. Can I set it on quote creation level ?


texts: How to show custom admin form tabs conditionally?

texts:
I need to show two tabs in admin custom form in which 2nd tab will only visible after I save the contents of first tab. Any one can tell me the way to do this.

This is what I have -

protected function _beforeToHtml()
{
    $product_content = $this->getLayout()->createBlock('bulkpricechanger/adminhtml_bulkpricechanger_edit_tab_product', 'adminform_products.grid')->toHtml();
    $serialize_block = $this->getLayout()->createBlock('adminhtml/widget_grid_serializer');
    $serialize_block->initSerializerBlock('adminform_products.grid', 'getSelectedProducts', 'products', 'selected_products');
    //$serialize_block->addColumnInputName('position');
    $product_content .= $serialize_block->toHtml();
    $this->addTab('associated_products', array(
    'label' => Mage::helper('bulkpricechanger')->__('Select Products'),
    'title' => Mage::helper('bulkpricechanger')->__('Select Products'),
    'content' => $product_content
    ));

    // $this->addTab("form_section", array(
    // "label" => Mage::helper("bulkpricechanger")->__("Update Price Settings"),
    // "title" => Mage::helper("bulkpricechanger")->__("pdate Price Settings"),
    // "content" => $this->getLayout()->createBlock("bulkpricechanger/adminhtml_bulkpricechanger_edit_tab_form")->toHtml(),
    // ));

    return parent::_beforeToHtml();
}

This is what i have in Tab.php I need to show the "form_action" tab to be shown only after products are selected from "associated_produts" tab.


texts: Magento event after filling checkout shipping address

texts: Which magento event gets triggered after filling shipping address on checkout one page as I need to pass some information to a third party api just after shipping address.