texts: Custom signup form assign customer to customer group

texts:
I made a copy of the default Magento ce 1.9.1 customer signup form. I then added the below fields to the form

  <input type="hidden" name="group_id" value="3">
  <input type="hidden" name="success_url" value="./vipsuccess">
  <input type="hidden" name="error_url" value="" />

Then I copied the AccountController.php from the core/mage/customer/controllers/ to local/mage/customer/controllers  I then added the below code to the public function createPostAction() section.
However my issue is that when I use the form to create an account the customer is still assigned to the general group?

   public function createPostAction()
{
    $errUrl = $this->_getUrl('*/*/create', array('_secure' => true));

    if (!$this->_validateFormKey()) {
        $this->_redirectError($errUrl);
        return;
    }

    /** @var $session Mage_Customer_Model_Session */
    $session = $this->_getSession();
    if ($session->isLoggedIn()) {
        $this->_redirect('*/*/');
        return;
    }

    if (!$this->getRequest()->isPost()) {
        $this->_redirectError($errUrl);
        return;
    }

    $customer = $this->_getCustomer();
/** * Get Customer ID from customer registration form or if its not set in form post then use default. */
    if($this->getRequest()->getPost('group_id'))
     {
         $customer->setGroupId($this->getRequest()->getPost('group_id'));
     }
     else
     {
         $customer->getGroupId();
     }

    try {
        $errors = $this->_getCustomerErrors($customer);

    if (empty($errors)) {
            $customer->cleanPasswordsValidationData();
            $customer->save();
            $customer->setGroupId($this->getRequest()->getPost('group_id'));
            $customer->save();
            $this->_dispatchRegisterSuccess($customer);
            $this->_successProcessRegistration($customer);
            return;
        } else {
            $this->_addSessionError($errors);
        }
    } catch (Mage_Core_Exception $e) {
        $session->setCustomerFormData($this->getRequest()->getPost());
        if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
            $url = $this->_getUrl('customer/account/forgotpassword');
            $message = $this->__('There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.', $url);
        } else {
            $message = $this->_escapeHtml($e->getMessage());
        }
        $session->addError($message);
    } catch (Exception $e) {
        $session->setCustomerFormData($this->getRequest()->getPost());
        $session->addException($e, $this->__('Cannot save the customer.'));
    }

    $this->_redirectError($errUrl);
}


texts:
Somehow our automated email reminder rules have stopped working meaning that our Abandoned cart emails have stopped sending.  If I look in the cron_schedule table I see a few rows that have a status of running but they never seem to clear.

All in all I have 184 rows that are stuck in 'running' and the last one which seems to get generated when cron runs is in 'pending'.

schedule_id: 1679947
    job_code: send_notification
      status: running
    messages: NULL
  created_at: 2013-04-14 01:40:08
scheduled_at: 2013-04-14 01:45:00
 executed_at: 2013-04-14 01:50:10
 finished_at: 0000-00-00 00:00:00

schedule_id: 1845067
    job_code: send_notification
      status: pending
    messages: NULL
  created_at: 2013-07-22 15:45:04
scheduled_at: 2013-07-22 15:45:00
 executed_at: 0000-00-00 00:00:00
 finished_at: 0000-00-00 00:00:00

Can I just clear these jobs from cron schedule and if I do is that likely to make the email reminders start working again?  What we don't want is for customers who had abandoned baskets to suddenly get a load of emails, we just want newly abandoned baskets to be notified.


texts: Magento 2.2.9 - Admin page error console-logger.js

texts:
I did an update from Magento 2.2.7 to 2.2.9 and now when I want to access to the admin page I have an error message :

main.ERROR: Unable to resolve the source file for 'adminhtml/Magento/backend/en_US/Magento_Ui/js/lib/logger/console-logger.js' [] []

Can you help me?


texts: The purpose of the http verbs interfaces

texts:
In Magento 2.3 there are some interfaces for all the http verbs

Magento\Framework\App\Action\HttpPostActionInterface
Magento\Framework\App\Action\HttpGetActionInterface,
...

All of them are empty and implement Magento\Framework\App\ActionInterface.
I also found that all of them are mapped in app/etc/di.xml to a parameter of Magento\Framework\App\Request\HttpMethodMap and a lot of the controllers implement these interfaces.
But not all controllers.
That's all I could find about them.
What's their purpose?


texts: How to Update customer Attribute and which table it will be stored?

texts:
I treid to create customer attribute programatically and now i want to update that the attribute with different label and type . I want to know in which table it will stored . I want to remove that attribute also.

public function install(ModuleDataSetupInterface $setup,ModuleContextInterface $context)

    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY,
            'phone_number',
            [
                'type'         => 'varchar',
                'label'        => 'Mobile',
                'input'        => 'integer',
                'required'     => true,
                'visible'      => true,
                'user_defined' => true,
                'position'     => 999,
                'system'       => 0,
            ]
        );
        $eavSetup->updateAttribute('customer', 'phone_number', 'type', 'varchar');
        $attribute = $this->eavConfig->getAttribute(Customer::ENTITY, 'phone_number');
       $attribute->setData(
            'used_in_forms',
            ['adminhtml_customer', 'customer_account_create']

        );

        $attribute->save();
    }


texts: I have a rule that has been working fine.  If a client orders more than $500 but less than $1000, they automatically receive a 5% discount.  I want to add a rule that says if they order more than $1000, they automatically receive a 10% discount.  I have tried the rule 6 times, and every time, it is applying the rule to the entire cart, even if the amount is $50.00.  I have double and triple checked the rule.  There are no conflicts with the first rule, and the conditions are written correctly.  I have re-indexed the site, and cleared the cache, after I implemented the new rule.  Not sure what to try next...assistance appreciated.


texts: Magento 2: How to set multi websites on the same URL?

texts:
Is it possible to run two Magento 2 websites on a single domain? I want to share the user between this websites. but want to redirect them to different stores (same URL - without store code) after they login based on their user group. That two store will be having same catalogs and identical store view.

I'm just doing this for separate user experience, like to make available different payment method, shipping and catalog visibility based on the user group, that is not available in magento base setup.


texts: Is it possible to hide the shipping method step on magento checkout process

texts:
Is it possible to hide the shipping method step on the Magento checkout process? I want to remove the shipping method step only on the checkout page, not permanently.

What I am trying to achieve is on the cart page when the customer enters his postcode for shipping estimate and then update total. I will want to use the choice he made here for his order. So I see no relevance for him to alter his shipping choice afterward as I only have one shipping option.

I have searched around and found there are ways of removing the step altogether and enabling a default shipping method. However, I am using a table matrix so the shipping charge differs based on postcode entered, so I cannot set it as a default.

Please, can you advise if it is possible to achieve what I want and if so how would I approach it?

Advice and guidance are appreciated.

Thanks

EDIT: I have seen on methods/explanation on how to remove the shipping step. However, I do not want to remove it altogether. I just want to hide it, but carry on the process. I have tried to remove the step from the Abstract.php file. However, this removes the step, but will not let you proceed to next step


texts:
First of all, this is not a duplicate of some other question on Magento SE.

I am working to build a custom requirement of guest wishlists. I have searched for some help on the Internet and also dug Magento's core module of wishlists but still, I am not able to find the right way to start.

I understand that it can be achieved by using cookies, but I am not able to find which changes I would need to make in core Magento tables and which functions should be pluginized or overridden.

I don't want a complete programmatic solution.

I just want to get some guidance to catch the right direction.

Please help.


texts:
Recently I've uploaded a few products in my Magento 2, they are enabled and inserted in the correct category but they do not appear even if I try to search them, I can see them only if I write the URL directly. what could be the reason?
I tried to refresh Magento cache but nothing's changed.
thank you


texts: life-span and scope of oAuth Acess token

texts:
I'm working on Magento OAuth for integration with a third party app.I have a couple of questions:

For how much time span an access token remains valid?
What is the scope of token based authorization calls?

(e.g if a call is made based on let's say token 1,meanwhile another token(token 2) is generated, will the first call based on token 1 be still valid? )


texts: how do I set the discount as buy any 3 products of a brand and get 10 $ discount.

texts: I have been trying out a discount rule but couldn't achieve it in the desired way. I have created a rule in which buy any 3 products of a brand and get 10 AED discount. The rule works perfectly if I add three 3 quantities of a single product, But doesnt work when I add three different products of 1 quantity each.


texts: Is it possible to set the same tax rate to all the countries.Instead of setting the tax rate for each country

texts: I want set the equal tax rate for all the countries.For example i am in global store, in checkout if i select any country same tax should be applied.(if we set the tax rates for each countries separately is it possible but instead of setting for each country is it possible.)


texts:
I am trying to fix the [ReflectionException]Class Not_Existing_Class error shown here- Magento2 - Setup Compile Error - Class Not_Existing_Class does not exist

The answer suggests this code change- https://github.com/magento/magento2/commit/e07ce7367563d1ffbb693824621e43c9f0f92cb0

if (preg_match($pattern, $fileItem->getRealPath()))

to

if (preg_match($pattern, str_replace('\\', '/', $fileItem->getRealPath())))

in the classesscanner.php file.

But when I look at my file the code is-

if (preg_match($pattern, str_replace('\\', '/', $fileItemPath)))

Which one is correct?


texts:
Magento how to update billing/shipping order before place order for guest.

I know what observer event I need to use and familiar with it. What I want to know is how to get billing/shipping or and what code write to update it. I've only found information about how to update a address of already placed order.


texts: Magento 2 Server Side Compilation and Grunt Result in 404 Errors in Developer Mode

texts:
I am currently working on a theme that I have used and have been changing the templates and styles following the detailed guides over at the Magento2 site.

However, I am really struggling to make progress and am not quite sure what I am doing wrong.

From my understanding of the documentation I can use server side compilation and Grunt to make the changes necessary to progress my developments.

This sounds great, so I installed Grunt and that is working fine, but my issue is that I keep getting loads of 404 errors around pub/static files not existing.

This is strange as from my understanding these files should be generated automatically.

What seems to work is when I run:

php bin/magento setup:static-content:deploy en_GB

But, I don't want to do that each time and it also means that when I run:

grunt watch:theme_name

No changes are detected.

A couple of notes to try and help understand where I have come from:

I am in developer mode
I have cleared the contents of var and pub/static
I am on Magento 2.0.7 updated via composer
I have run php bin/magento setup:upgrade
I also get the same 404 errors when I access the admin area
I have run grunt refresh, grunt exec:all and grunt less to compile all less, but still have the same issues
Some digging around seemed to point to symlinks, but I have not been able to work it out

I am sure there is one small thing I am missing or not doing. If anyone could help that would be great as I am tearing my hair out.


texts: Cart link or cart Button using magento API

texts:
I am fetching all the products information outside of the magento installation so I am using soap api. I am unable to fetch cart url on which after clicking on, it will be redirected to my magento installation and it will be added to cart for the user

How do I get the Cart url using magento API. I have tried the url which is dynamic.. however it is redirecting me blank cart. It is showing "Shopping Cart is Empty"

  http://example.com/checkout/cart/add/product_id/56/qty/1

I have checked on magento installation it uses the button onclick event

<button onclick="setLocation('http://example.com/checkout/cart/add/uenc/aHR0cDovL2VzaG9wbnNlbGwuY29tL2VzaG9wbnNlbGwuaHRtbD9TSUQ9ZTYyMTJhMzFjY2NmYTU1NzAwMGIxYjNkYTAwODY2Y2I,/product/56/?SID=e6212a31cccfa557000b1b3da00866cb')" class="button btn-cart" title="Add to Cart" type="button">Add to Cart</button>

how this is passing the url

'http://example.com/checkout/cart/add/uenc/aHR0cDovL2VzaG9wbnNlbGwuY29tL2VzaG9wbnNlbGwuaHRtbD9TSUQ9ZTYyMTJhMzFjY2NmYTU1NzAwMGIxYjNkYTAwODY2Y2I,/product/56/?SID=e6212a31cccfa557000b1b3da00866cb'

Thanks :)


texts: Magento 2 : how to add row url title in grid

texts:
Is there any way to add title on getRowUrl in grid magento2. Below is my code

public function getRowUrl($row)
    {
        return $this->getUrl('*/*/edit', ['id' => $row->getId()]);
    }


texts: main.CRITICAL: Notice: Undefined index: default in CompositeConfigProvider.php on line 160

texts:
I have currently a problem with my Magento 2 (2.3.2)

I'm using the Webkul multi vendor module and when I open a seller profile, the profile view is empty.

I've checked the system.log and got this:

  [2019-07-31 08:28:54] main.CRITICAL: Notice: Undefined index: default
  in
  /opt/bitnami/apps/magento/htdocs/vendor/magento/module-cms/Model/Wysiwyg/CompositeConfigProvider.php
  on line 160 [] []

    /**
 * Update config using config provider by active editor path
 *
 * @param \Magento\Framework\DataObject $config
 * @param array $configProviders
 * @return \Magento\Framework\DataObject
 */
private function updateConfig($config, array $configProviders)
{
    $adapterType = $this->getActiveEditorPath($config);
    //Extension point to update plugin settings by adapter type
    $providerClass = isset($configProviders[$adapterType])
        ? $configProviders[$adapterType]
        : $configProviders['default'];     <--### Here is the Error position ###
    /** @var \Magento\Framework\Data\Wysiwyg\ConfigProviderInterface $provider */
    $provider = $this->configProviderFactory->create($providerClass);
    return $provider->getConfig($config);
}

Somehow the $configProvider is empty, but I don't know why it is empty.

Did someone had the same error?

Greetings


texts: Magento 2 + Varnish - Product pages not updating when product is updated

texts: I have Varnish 6.4 set up with Magento 2.4.2 in Kubernetes, and can confirm it is set up correctly by the "x-magento-cache-debug HIT" header. However, when I update a product, the product page isn't updating, presumably it is serving the cached old product page. Is there something I have to set up in Magento to get it to inform Varnish when a product etc has updated?


texts:
I am a newbie. I have 2 new site I have installed Magento 1.8. I have installed templates I bought from Template Monster. I have installed the demo home page html and demo home page xml. But the sidebar will not go away?

Both themes say they are "2 columns" but in Magento admin the layouts available are "2 column with right bar" or "2 column with left bar".

Any ideas?


texts:
What is the simplest two web server, single DB load balancing?

Will this work for community out-of-the box?

I assume, at minimum, I would have to store sessions in the database rather than filesystem?

Any other considerations?


texts: Magento 2.1.17 product imported but product images not show

texts:
I want to import product in Magento 2.1.17 product imported but images show error -

  Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 1,2.

I import product using localhost.
/JD0068-A-1.jpg
I used this path for image


texts: Magento CE 2.0 installation stops at about 90%

texts:
This the first time I work with Magento, I tried to install Magento CE 2.0, But it's stick on 90%" :

I increase the max_execution_time as mentanyt here But not work !

I also increase it to 28000, no luck :(

Any suggestion please ..

(Mac OSx Capitan, MAMP Server, PHP 5.6.10, mysql 5.6.25)

Thanks in advance

Abdusalam


texts: Why does getAgreements() return nothing?

texts:
I've made a custom module, with the ability to print the terms and conditions on a static page. I've achieved this by posting a question on Stack, which answer worked for me:
Show terms and conditions on static page

(I've followed to above exactly)

Now, I've created the module with the intention to be reused in other instances of Magento 2(.2.3). So, I've installed the module on a clean installation of Magento 2:

Enabled developer mode
Created corresponding vendor folder
Uploaded the module to the vendor folder
ran php bin/magento setup:upgrade
ran php bin/magento setup:di:compile
created terms and conditions
enabled the function in the backend (I created a Helper for this)
ran php bin/magento cache:flush
Browsed to http://www.mywebshop.com/termsconditions

The /termsconditions url loads correctly, so this means the module is working. But somehow, the code which gets the agreement content, returns empty?

This all may sound like a stupid question, but as far as I know, there shouldn't be going something wrong.

var_dump of $block->getAgreements() returns

array (size=0)
  empty

Whilst I have created terms and conditions via the admin menu and which show up correctly.

Also the terms and conditions show up in the DB.

Someone who knows what I might have forgotten or what is going wrong?

The code in .phtml

<?php
/**
 * @var $block \Magento\CheckoutAgreements\Block\Agreements
 */
?>

    <?php var_dump($block->getAgreements()) ?>
    <?php foreach ($block->getAgreements() as $agreement): ?>

            <?php if ($agreement->getIsHtml()):?>
                <?php /* @escapeNotVerified */ echo $agreement->getContent() ?>
            <?php else:?>
                <?php echo nl2br($block->escapeHtml($agreement->getContent())) ?>
            <?php endif; ?>

    <?php endforeach ?>

Layout file:

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <title>Terms and Conditions</title>

        <referenceBlock name="page.main.title" remove="true" />
        <referenceContainer name="content">
            <block class="Magento\CheckoutAgreements\Block\Agreements" name="terms_conditions"  template="Vendor_TCRender::terms.phtml"/>
        </referenceContainer>

</page>


texts: How to use inline translate on custom block?

texts:
I have enabled inline translate on the front end and can see the red box and book around certain elements.

In my .phtml file I have
<?php echo $this->__('my custom text');?>
. I can change this by .csv (located in /app/design/frontend/package/theme/locale/en_GB/translate.csv) but I cannot get the inline translate to work.

The block type is core/template.

How do I get Magento to allow me to alter this text via front-end inline translate?

Other posts suggest wrapping the text in span tags. I have done this and this has not helped.

I have added the text and translation to the core_translate table but that was not being detected.


texts: Magento 2: phone number validation (only accepts numbers)

texts: In Magento 2, I want to make phone fields number validation, (eg in the checkout page) only accepts numbers (and not characters)?


texts: What causes the Magento2 interfaces and APIs to leak implementation details at every orifice?

texts:
One of the things that surprised me so much, after spending multiple times more than working with typical platform, is the degree undocumented and ever changing implementation details must be known to do anything.  Even the most basic administration commands, removing modules... you must care for the cache, why isn't that part of the command?  Why does everything appear to be half completed?

You need to use the API to search for products, but not so fast, Did that mean searching for products as they'd be displayed on the front, or searching for them as they'd appear on the back?

Instead of anticipating well known use cases and planning to address them... we just expose more implementation details, and each must be already known before hand.  How?  Why? Now repeat that for EVERYTHING, and you have an answer to why development on magento2 is 6 to 1.


texts: How to use After order place event in Magento 2

texts:
After order place get customer attribute value and set order status in Magento 2.
Thanks.


texts:
I'm trying to remove a static block from homepage, using local.xml.

Tried:

<cms_index_index>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/jquery.flexslider.js</name></action>
    </reference>

    <reference name="content">
        <remove name="banners-homepage"/>
    </reference>
</cms_index_index>

But the page still shows the static block (banners-homepage, which war created as static cms block).

What is my mistake? Cache is disabled.

Following is the cms page code relative to that block:

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="5"}}


texts:
I want to display Banner slider on my PWA homepage which is added in magento2.
Please help.


texts: How to create custom pdf on controller action using TCPDF in magento 2

texts:
I have added TCPDF as follows:

Downloaded TCPDF library from https://github.com/tecnickcom/tcpdf
and place at magento2.0/lib/internal/TCPDF
Renamed tcpdf.php to TCPDF.php
Opened TCPDF.php and change class name to class TCPDF_TCPDF
Created Controller

  magento2.0/app/code/Namespace/Module_Name/Controller/Generatepdf/createpdf.php

<? php

namespace Namespace\Module_Name\Controller\Generatepdf;

use TCPDF_TCPDF;

use Magento\Framework\App\Filesystem\DirectoryList;

class Createpdf extends \Magento\Backend\App\Action  {

public function execute() {
$baseDir = DirectoryList::MEDIA;

$tcpdf = new TCPDF_TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information

    $tcpdf->SetCreator(PDF_CREATOR);

    $tcpdf->SetAuthor('Nicola Asuni');

    $tcpdf->SetTitle('TCPDF Example 001');

    $tcpdf->SetSubject('TCPDF Tutorial');

    $tcpdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data

    $Header_title = 'Sample PDF';

    $tcpdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . $Header_title, PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));

    $tcpdf->setFooterData(array(0, 64, 0), array(0, 64, 128));

// set header and footer fonts

    $tcpdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));

    $tcpdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font

    $tcpdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

// set margins

    $tcpdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

    $tcpdf->SetHeaderMargin(PDF_MARGIN_HEADER);

    $tcpdf->SetFooterMargin(PDF_MARGIN_FOOTER);

// set auto page breaks

    $tcpdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

// set image scale factor

    $tcpdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

// set some language-dependent strings (optional)

    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {

        require_once(dirname(__FILE__) . '/lang/eng.php');

        $tcpdf->setLanguageArray($l);

    }

// ---------------------------------------------------------

// set default font subsetting mode

    $tcpdf->setFontSubsetting(true);

//your htmls here

$html = **For PDF file Write Your HTML Code here** ;

// set some language dependent data:

    $lg = Array();

    $lg['a_meta_charset'] = 'UTF-8';

    $tcpdf->setLanguageArray($lg);

// set font

//dejavusans & freesans For Indian Rupees symbol

    $tcpdf->SetFont('freesans', '', 12);

    // remove default header/footer

//$tcpdf->setPrintHeader(false);

    $tcpdf->setPrintFooter(false);

    $tcpdf->AddPage();

    $tcpdf->writeHTML($html, true, false, true, false, '');

    $tcpdf->lastPage();

//$tcpdf->Output('report_per_route.pdf', 'I');

    $this->logger->debug('report_per_route');

    $filename = $baseurl . '/Sample_pdf'. time().'.pdf';

    $tcpdf->Output($filename, 'F');

}

}

? >

I want to understand how to add my code in above class. My required PDF should contain fileds like Order Number, Customer Name, Item Name, Item Quanity. I am getting these values in my custom template file from Order collection.

Thanks in advance !!


texts: Magento - customers to have a image and video gallery attached to their profile

texts: As part of my website i need customers to have a media gallery a part of their account where they can upload multiple photos to their account. I have tried to search for extensions and help on this topic but I cannot find anything all I can find is allowing customers to upload product images which I do not want. could anyone give me some advice on this or an extension that does what I need it to do? (It would need to be an extension on the customer account that allows multiple photos to be added)


texts: How to display custom message in console when your custom module is successfully installed?

texts:
I am wondering how to display a custom message when installing your own custom module by presumably using and defining the correct operations in the InstallSchema class. Which is the best way to display a custom message. e.g.: You built a custom module that needs some initial configuration from the admin panel, and so you ideally want the user to see the following message after successfully installing it by running php bin/magento setup:upgrade

[Vendor_Module] is installed successfully, but you need to enable it and
configure it from the admin panel in the [Module_Tab_Name] section.

How can someone achieve it in Magento 2?


texts: How to bind an event handler to 'street[0]' input on the checkout page?

texts:
I've been trying to ensure an alert displays on a user typing in PO BOX number in the street address field on the checkout page, saying we don't ship to PO BOX.
My jQuery code doesn't seem to bind a change event to this field. The code snippet is placed in a custom JS file that loads once the DOM is ready.
Is it something possible on the checkout page since the checkout in Magento is a complex part involving Knockout JS and all that?
Any advice/help would greatly be appreciated. Screenshot explaining the requirement attached.

//    reject PO Boxes in first line of shipping address
    if (docloch.indexOf("checkout")>-1) {
        var poBox = /^ *((#\d+)|((box|bin)[-. \/\\]?\d+)|(.*p[ \.]? ?(o|0)[-. \/\\]? *-?((box|bin)|b|(#|num)?\d+))|(p(ost)? *(o(ff(ice)?)?)? *((bo          x|bin)|b)? *\d+)|(p *-?\/?(o)? *-?box)|post office box|((box|bin)|b) *(number|num|#)? *\d+|(num|number|#) *\d+)/i;

        $('[name="street[0]"]').change(function(){
            if ( ($(this).val()).match(poBox) !== null){
                $(this).val("");
            }
//        });
//    }


texts: Override advanced pricing from product with catalog price rule

texts:
I've create a customer group called: "Dealers", the idea is that they have in their account a 10% discount on all the store.

The problem i'm facing is that if I set a product, let's say "Product A", on sale with Special Price, from 100$ to 80$, that means a 20% discount, right? Well, the Dealer Account sees that 20%, which shouldn't.

I've deactivated the subsequent rules but what I'd like to do is for this "Dealer" Customer's Group to only have that 10% discount active, and no other discounts can override that.

Can that be done?

Thank you very much!


texts: Magento 2 how to add date of birth in checkout (date picker)

texts:
I want to add the date of birth date picker in checkout only for guest users.
I have read a few things which indicate that I have to use knockoutjs.
But I wasn’t sure what is the correct way to approach this.
Is there anything I could follow as in guideline or any help I could use


texts:
I applied the SUPEE-11314 patch in magento 1.7.0.2 but secuity scan shows the below error.
SUPEE-11314 - Failed.Weak password requirements found (MPERF-10886)
can I know what is the issue.
Thanks


texts:
In My website breadcumbs are not coming properly
If i Open Caretogry -> Subcategory -> Vertical it showing Properly

If i Open any Product In that Vertical it is showing like
Home -> Productname Directly

My Requirement if i open any prodcust it has to show complete path in Breadcumbs.


texts:
I'm trying to add PHP Static test at Frontools to simplify and improve testing process and if it's possible increase performance, b/c it takes so long to get any results.

GH Issue - https://github.com/SnowdogApps/magento2-frontools/issues/45

I'm not familiar with PHP testing libs / tools, so have few questions for you:

Is there any reason why M2 use testing libs (PHPUnit and PHP_CS) from 2014 instead of fresh one?
Is it normal that output of this test looks like a mess and it's hard to understand what and where something wrong happened? I compare it with output of code quality tests for CSS/JS and it's a nightmare. Is there any better reporter available or some other way to get a meaningful report, instead of something looking like a PHP backtrace?
Is there any reason why it's so slow? It take ~7-8 minutes to analyse template files. Most of front-end tests in worst case take a few seconds, so there is no way to get live feedback about issues.
How to run this type of tests when we have single module (i.e. theme), not whole Magento 2 instance (CI tests)?
It looks like PHP_CS has already a simple wrapper for Gulp, but I'm not sure where configuration is stored. Is it in /.php_cs file?


texts: Magento 2.3.3 - Import Newsletter subscribers along with email, Name, Type, Website, Store, Store view from CSV

texts:
I run a multi website and store setup, on PHP 7.1

I'm trying to import newsletter subscribers from a CSV as follows, which is in a CSV file called subscribers-import.csv in the root dir.

I'm using the following code in a file called import.php in the root dir.

<?php
  ob_start();
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$store_id = 1;
$csv_filepath = "subscribers-import.csv";
$csv_delimiter = ',';
$csv_enclosure = '"';
$magento_path = __DIR__;

$params = $_SERVER;

$bootstrap = Bootstrap::create(BP, $params);

$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$websiteId =  $obj->get('Magento\Store\Model\StoreManagerInterface')
    ->getStore()
    ->getWebsiteId();

$customerAccountManagement =$obj
    ->create('Magento\Customer\Api\AccountManagementInterface');

$_subscriberFactory = $obj->create('Magento\Newsletter\Model\SubscriberFactory');

if (($handle = fopen("subscribers-import.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        // email Id
        $emailId =  $data[1];
       /* customer */
        if($customerAccountManagement->isEmailAvailable($emailId , $websiteId)){
            echo $emailId ."
";
            $_subscriberFactory->create()->subscribe($emailId );
        }else{
            echo $emailId ."Register
";
            $customerFactory = $obj->get('Magento\Customer\Model\CustomerFactory');
            $customer=$customerFactory->create();
            $customer->setWebsiteId($websiteId);
            $customer->loadByEmail($emailId );// load customer by email address
            if($customer->getId()){
                $_subscriberFactory->create()->subscribeCustomerById($customer->getId());
            }

        }
    }
    fclose($handle);
}
 ob_end_flush();
?>

Right now it only imports the email ID, as shown as follows.

How can I get it to import the rest of the data in the CSV like

  Type | Customer First Name | Customer Last Name | Status | Website Store | Store View


texts: Magento 2 How to add and call custom scss

texts:
I want to know how to add scss i tried in below way in default.xml but it's not working

<css src="sass/styles.scss" />

How to achieve this?

Or else give me the proper way how to place and call


texts: Custom routes with GET Params : HTTP RESPONSE 302 ; how to get GET params values?

texts:
etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="example" frontName="ex">
            <module name="Company_Package" />
        </route>
    </router>
</config>

  Controller/Index/Index.php

<?php

namespace Company\Package\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action {
    public function execute() {
        //get GET Params
    }

}

If I access to

mywebsite.com/ex

I have the correct page.

If I access to

mywebsite.com/ex?somethinggreat=1

I have a 302

How to get the value of "somethinggreat", and get a HTTP RESPONSE of 200 ?

(The solution might be in the controller's dockblock, or in the routes.xml file, but I can't find out exactly how.)


texts:
If i have the following store config paths:

catalog/my_custom_section/value_1
catalog/my_custom_section/value_2
catalog/my_custom_section/value_3
catalog/my_custom_section/value_4
catalog/my_custom_section/value_5

Is there a way to grab all of these at once in an array using getStoreConfig() instead of having to do the following:

$values = array();
$values[] = Mage::getStoreConfig('catalog/my_custom_section/value_1');
$values[] = Mage::getStoreConfig('catalog/my_custom_section/value_2');
etc..

Obviously i can improve that with a loop but im asking if there is a way in magento to do something like: Mage::getStoreConfig('catalog/my_custom_section/value_%'); and get an array back.


texts: remove empty space in static block in magento site

texts:
in home page, you can see "special categories " with 6 red images.

below those images some empty space is displaying.

I want to delete those empty space.

please help me to find solution.

thanks in advance.


texts:
We are using Marketplace in my website also some product have more then one seller. Even every seller have unique SKU

In Back end Sales Order page it showing Base seller Sku Only

How to fetch Assign seller SKU

<?php echo $this->helper('sales')->__('SKU') ?>: <?php echo implode('
', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?>


texts: Magento 2.0 does not Show a Bundle Product cart

texts:
i have one Question i have set up different Bundle products. But not all are showing in the category.
The settings are the same on each product. And booth are selected for this category.
Thanks and best


texts: Create new role with specific ACL rights

texts:
I want to create a new admin role with some rights.

So I use the following code :

    $role = $this->roleFactory->create();
    $role->setName('MyNewRole')
        ->setPid(0)
        ->setRoleType(RoleGroup::ROLE_TYPE)
        ->setUserType(UserContextInterface::USER_TYPE_ADMIN);
    $role->save();

    $resource = [
        'Magento_Sales::sales'
    ];
    $this->rulesFactory->create()
        ->setRoleId($role->getId())
        ->setResources($resource)
        ->saveRel();

This code works. However, I would like all the subcategories of Sales, not only "Magento_Sales::sales".

  For that, I know I can put the listing of all subcategories (for
  example : Magento_Sales::create Magento_Sales::invoice
  Magento_Sales::reorder ...)

But it's very long: there are 47

Does someone know how to do? Something like "Magento_Sales::*" or a recursive method maybe?


texts: Filter by Product's Custom Options or set diffrent options for each products from Attributes Sets

texts:
I don't know what is the best way of doing this.
The idea is that I have about 500 products. I created  11 Attribute Sets (to cover 11 product categories).
These attributes are filterable.
But I need to set different options for each product's attributes. So custom options are the only solution I see (I can't create different attributes for each product).

My questions:

How can I set different attribute options for each product?
If 1 is not possible, how can I make Custom Options Filterable? (like attributes "Use In Layered Navigation")


texts: Magento 2 : How to update customer password by customer repository

texts:
I want update customer password by customer repository.

Currently I am updating customer password like this

$this->_CustomerRepositoryInterface
    ->save($customer,$this->encryptor->getHash($password, true));

  \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository

but it is not working for me.

Any one know how to update customer password?


texts: Magento 2 frontend ui components grid for company users page not working.it's always spinning

texts:
Magento 2 company users page in frontend not loading.it's always spinning with loader.if we checked in console i am getting the following error.

The Company Users page is rendering by using ui_components.can any one please me help on that to resolve the issue.Thanks in advance.


texts:
please refer this url

http://www.utsavfashion.in/newarrivals/saree

Under the NEW ARRAIVALS category i have the subcategory named as SAREE, then All new catalogs is the subcategory of SAREE. Both category (SAREE, All new catalogs) page have the same url. how to achieve this?


texts: Magento 2 Customer Order Attribute SQL Error in Controller

texts:
I have been working on a project where I need to update and save data to a custom attribute to both customers and sales orders.  I have created the attributes for both models, and use a helper class for all of my methods.  I am using an observer and multiple controllers to call the helper methods, but have been receiving strange results.

Everything works as intended when the methods are executed from the observer, but when the methods are being executed from a controller, I receive a SQL error.  I also want to note that this error is only coming from the Order Resource Model when saving an order object, but not the Customer Resource Model when saving a customer object.

Here is some of the helper methods. This portion works as intended

 $this->_customer->setData('[NAMESPACE]_id', $value);
 $this->_customerResourceModel->save($this->_customer);

This portion is not working when called from controller. Works fine when called from observer

 $this->_order->setData('[NAMESPACE]_id', $value);
 $this->_orderResourceModel->save($this->_order);

This is the error that is returned after the method is called from a controller

  SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'magento2.[NAMESPACE]' doesn't exist, query was: INSERT INTO
  sales_order_grid ([NAMESPACE]_id) SELECT
  sales_order.[NAMESPACE]_id AS [NAMESPACE]_id FROM sales_order
           LEFT JOIN [NAMESPACE] ON sales_order.entity_id = [NAMESPACE].order_id WHERE (sales_order.entity_id = '77') ON DUPLICATE
  KEY UPDATE [NAMESPACE]_id = VALUES([NAMESPACE]_id)

I should note that I tried adding a [NAMESPACE] table, but that resulted in more SQL errors.  The only alteration to the database was to add columns to the customer and sales order tables, and add the attributes.

Any help or point in the right direction is greatly appreciated!  Thank you.

Here is the controller where the methods are being called

public function __construct(
    Context $context,
    \[NAMESPACE]\[MODULE]\Helper\Data $helper,
){
    $this->helper = $helper;
    parent::__construct($context);
}

public function execute()
{
    $id = $this->getRequest()->getParam('id');
    $transfer = $this->helper->transferOrder($id);

    $this->_redirect('sales/order/view/order_id/'.$id.'/');
}

Here is the observer where the methods are being called

public function __construct(
    \[NAMESPACE]\[MODULE]\Helper\Data $helper
)
{
    $this->helper = $helper;
}

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $id = $observer->getEvent()->getData()["order_ids"][0];
    $this->helper->transferOrder($id);
}

The $id values in all instances are correct.


texts: Magento 2.3 - Getting website id in the Observer

texts:
My observer :
<?php
namespace Gta\EnablePaymentMethod\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class PaymentMethodEnable implements ObserverInterface {

    protected $_customerSession;
    public function __construct(
       \Magento\Customer\Model\Session $customerSession
    ) {
       $this->_customerSession = $customerSession;
    }

    protected $_storeManager;
    public function __construct(
       \Magento\Store\Model\StoreManagerInterface $storeManager
    ) {
       $this->_storeManager = $storeManager;
    }

    public function execute(Observer $observer) {

      $website_id = $this->_storeManager->getStore()->getWebsiteId();
      if($website_id == '1')
      {

      $payment_method_code = $observer->getEvent()->getMethodInstance()->getCode();
      if ($payment_method_code == 'paypal_express') {
        $result = $observer->getEvent()->getResult();
        $result->setData('is_available', false);
       if ($this->_customerSession->isLoggedIn()) {
           $customerGroupId = $this->_customerSession->getCustomer()->getGroupId();
           if ($customerGroupId == 9) {
               $result->setData('is_available', true);
            }
        }
      }
    }
    }
}

Getting Fatal error:
Fatal error:  Cannot redeclare Gta\EnablePaymentMethod\Observer\PaymentMethodEnable::__construct() in /var/www/html/test/app/code/Gta/EnablePaymentMethod/Observer/PaymentMethodEnable.php on line 15
How to solve the error?
Note : Without website id condition observer working, i want to add website Id.


texts:
We have a Magento 2 multistore setup on a Dedidacted server with two stores views.

When we access one URL it has a normal load of 2-3 seconds, when accessing the other URL we have a load of +20 seconds.

www.fietsenwinkelonline.be -> normal load time
www.vliegendhert.be -> +20 seconds load time

Does anyone come accross this issue and/or has a fix for it or a nudge in the right direction?
If we need to provide more specifics please let us know.


texts:
Magento provides a functionality of customer groups,which are used through out our website.But is it possible to create sub groups to the parent groups and use them in efficiently through out our magento website?
I just have a basic knowledge of magento,I am confused that is it possible? If yes then how?
Can anyone help me!


texts: How to connect whole Native site of Magento in Mobile application?

texts:
Is it possible to connect whole Native Magento site with Fire-base ?

Without creating APIs or connection the default APIs.

Example

http://127.0.0.1/Magento23/catalog/product/view/id/2446/

Where Fire-base will create automatically dynamic links for all the
products

  NOTE :  I am aware about APIs and Magento's default APIs but As far I know Fire-base provides option for the same. So Anyone
  have any idea regarding connecting the native Magento to Firebase


texts:
I am trying to add a mailchimp popup to my magento site. So in the footer.phtml I added this:

<script type="text/javascript" src="https://downloads.mailchimp.com/js/signup-forms/popup/unique-methods/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>

<script>
jQuery(document).ready(function() {
function showMailingPopUp() {
  require(["mojo/signup-forms/Loader"], function(L) {
  L.start({"baseUrl":"mc.us16.list-manage.com","uuid":"34cc754j80ba938d52dc3e486f",
  "lid":"0b245fgj05b2"
  })
 })
 document.cookie = "MCPopupClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
 };
 jQuery(function() {
   jQuery(".open-popup").on('click', function() {
     showMailingPopUp();
     console.log('test');
   });
 });
});

</script>

But I am getting an error: Uncaught ReferenceError: require is not defined.

If I remove require I see test in my console when I click the popup link but no popup from mailchimp to be seen.

What am I doing wrong?


texts: Magento Customer Login and Account Creation content is not displaying

texts:
I have been working on a magento projects for some months now. So I have added my custom online payment integration.

After adding payment integration the content on all the page disappears leaving only the header and the footer. I have now recover the page that I can access back-end through cms->page but the login and registering a new customer account page cannot be done from the back-end.

The url for the login page is

Thanks


texts: How to avoid 404 error on new extension installation

texts:
It is a very common error that shows in Magento when you install a new extension with system.xml config:

When you go to the System->Configuration->Extension tab, a 404 error is shown. You need to logout and login again and then it is ok. But is there any way to avoid this?


texts: How is Varien_Db_Adapter_Pdo_Mysql::orderRand() optimized?

texts:
Magento comes with a method to randomly "order" collections:

$collection->getSelect()->orderRand();

It takes an optional parameter $field, that is eventually used in Varien_Db_Adapter_Pdo_Mysql::orderRand():

/**
 * Adds order by random to select object
 * Possible using integer field for optimization
 *
 * @param Varien_Db_Select $select
 * @param string $field
 * @return Varien_Db_Adapter_Pdo_Mysql
 */
public function orderRand(Varien_Db_Select $select, $field = null)
{
    if ($field !== null) {
        $expression = new Zend_Db_Expr(sprintf('RAND() * %s', $this->quoteIdentifier($field)));
        $select->columns(array('mage_rand' => $expression));
        $spec = new Zend_Db_Expr('mage_rand');
    } else {
        $spec = new Zend_Db_Expr('RAND()');
    }
    $select->order($spec);

    return $this;
}

My question is

How is RAND() * integer_column an optimization in comparison to RAND() and isn't the result skewed in favor of larger integer_column values? Is there a better way to retrieve random results using Magento collections? Ordering by RAND() gets expensive for large tables.


texts:
So I have a module (Menu) that I built following a tutorial and I want to treat it as an area. I then want to build other modules (I have Magento's Hello World module currently integrated for testing) but I haven't been able to find anywhere how I can append hello world to my menu url?

e.g. the url for hello world is: /admin/helloworld/hello/index/
what I would like is something like /admin/myMenuFrontName/helloworld/hello/index/

but I'm not sure where to even begin. Any help would be much appreciated.


texts: Magento2: Change store view in product list of admin panel

texts:
Is it possible to change the store view in the product list of admin panel?

Currently Magento 2 lists product names as saved in one particular store view and that makes things difficult because that language is not not understood by admins. Magento somehow overrides the default value (website level) of the product name with product name taken from one of the store views.

UPDATE:
You can select the default store view for Store level in Stores -> All Stores. There is still missing a store view changer in Catalog.


texts:
I'm trying to update my magento from command line.
I changed mage permissions to 755

 chmod 755 mage

Then I launched mage-setup

./mage mage-setup

But when I try other commands the following error occurs

Please initialize Magento Connect installer by running:
./mage mage-setup


texts: Magento 2.2.2 REST API - I need to change the customer password using REST API

texts:
Magento rest API - I need to change the customer password using REST API.

  In POSTMAN application

url action :: PUT

http://magento.host/rest/V1/customers/me/password?customerId=146

And i passed integration token in header.

Authorization :: Bearer <Token Value>
Content-Type :: application/json

And In Form-data

customerId :: <customerId>

currentPassword :: <currentPassword>

newPassword :: <newPassword>

webapi.xml code is

<route url="/V1/customers/me/password" method="PUT">
    <service class="Magento\Customer\Api\AccountManagementInterface" method="changePasswordById"/>
    <resources>
        <resource ref="self"/>
    </resources>
    <data>
        <parameter name="customerId" force="true">%customer_id%</parameter>
    </data>
</route>

But it give me error

  {"message":"Decoding error: \nUnable to unserialize value.\n#0
  /var/www/html/rb-dev/vendor/magento/framework/Webapi/Rest/Request/Deserializer/Json.php(64):
  Magento\Framework\Serialize\Serializer\Json->unserialize('------WebKitFor...')\n#1
  /var/www/html/rb-dev/vendor/magento/framework/Webapi/Rest/Request.php(141):
  Magento\Framework\Webapi\Rest\Request\Deserializer\Json->deserialize('------WebKitFor...')\n#2
  /var/www/html/rb-dev/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(91):
  Magento\Framework\Webapi\Rest\Request->getBodyParams()\n#3
  /var/www/html/rb-dev/vendor/magento/module-webapi/Controller/Rest.php(322):
  Magento\Webapi\Controller\Rest\InputParamsResolver->resolve()\n#4
  /var/www/html/rb-dev/vendor/magento/module-webapi/Controller/Rest.php(239):
  Magento\Webapi\Controller\Rest->processApiRequest()\n#5
  /var/www/html/rb-dev/vendor/magento/framework/Interception/Interceptor.php(58):
  Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#6
  /var/www/html/rb-dev/vendor/magento/framework/Interception/Interceptor.php(138):
  Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch',
  Array)\n#7
  /var/www/html/rb-dev/vendor/magento/framework/Interception/Interceptor.php(153):
  Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#8
  /var/www/html/rb-dev/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(39):
  Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch',
  Array, Array)\n#9
  /var/www/html/rb-dev/vendor/magento/framework/App/Http.php(135):
  Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#10
  /var/www/html/rb-dev/generated/code/Magento/Framework/App/Http/Interceptor.php(24):
  Magento\Framework\App\Http->launch()\n#11
  /var/www/html/rb-dev/vendor/magento/framework/App/Bootstrap.php(256):
  Magento\Framework\App\Http\Interceptor->launch()\n#12
  /var/www/html/rb-dev/index.php(39):
  Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#13
  {main}","trace":null}

Anyone have any idea?
Thanks in advance.


texts: What observer need to use for NO-COUPON code apply option in magento?

texts:
In magento Shopping cart price rules, I need to customize NO-COUPON code option in store basis.I have completed the coupon code option(Store basis) when we enter the coupon code and submit. Magento have no-coupon code option in which discount amount automatically has been applied. But I don't know how to customize NO-COUPON code option.Where can I add a condition to apply coupon code automatically only for selected stores.?

Thanks in advance.


texts: Magento Shopping Cart Price Rule and Tier Price

texts:
Here's what I am trying to achieve.

I have some products which have tiered pricing set for them. When purchasing one unit of such an item the regular price will apply. Whenever buying two units of such an item the price will drop. Whenever buying three units of such an item the price will drop even more.
I also have set a Shopping Cart Price Rule which will give customers a 10% discount whenever they use the coupon code "GIVEME10".
I don't want this discount to apply to products with tiered pricing, at least not when 2 or more units of such an item are purchased, since the customer will already get a discount due to tiered pricing.

Here's what I have done so far.

First, under Catalog > Attributes > Manage Attributes > Tier Price > Frontend Properties I have set Use for Promo Rule Conditions to Yes in order to use the tier_price attribute to create Shopping Cart Price Rules.

Second, I have set conditions in my Shopping Cart Price Rule which should prevent applying the coupon to two or more units of an item with tiered pricing.

Please find a screen shot of my current condition settings below.

The problem is that the use of the coupon is allowed by the system even when I put 2 or more units of a tier priced item in the shopping cart.

What am I doing wrong?


texts: Uncaught Error [object Object] at Object. (customer-data.js:86)

texts:
I am seeing the following error in the console on every page of our site (Magento 2.1.4)...

Failed to load resource: the server responded with a status of 400 () - customer/section/load/?sections=review&update_section_id=false&_=1507203330016
Uncaught Error: [object Object]
at Object.<anonymous> (customer-data.js:86)
at fire (jquery.js:3099)
at Object.fireWith [as rejectWith] (jquery.js:3211)
at done (jquery.js:9312)
at XMLHttpRequest.callback (jquery.js:9720)

It only seems to appear when I merge the JS in admin. If JS is not merged then the error does not appear.

Does anyone know what this is related to (other than the merge of JS)?

I checked this answer: TypeError: options is undefined (customer-data.js) but I have not extended Magento_Customer module so I dont think it is related.

Thanks for any help


texts: Apply promotional rule on customer group price in magento 2

texts:
How can I apply promotional rule to customer group price or special price. As default magento apply promotional rule always on base price of product and then after it is using lowest value to use.
For eg product has price of $50 and for particular customer group price is set to $40. And we do have one promotional rule to apply 10% discount. But now here the case is if we login with that customer group customer then magento apply that promotional rule on base price which is $50 which is ideally not proper. It should apply that promotional rule on $40 as we logged in with customer group and it has price set as $40.
So here my requinment is to apply promotional rule on customer group price instead of base price. So how can I achieve it in magento .
Please help me out with this. Thanks in advance.


texts: when sendOrderUpdateEmail function work?

texts:
I have sendOrderUpdateEmail in my module but this function, some times work and send email and some times,NOT.

I think this work if for example my prev. status was "NEW"

In which status, this function work and send update email to customers?

If I want to send update email for all status, how can I use this method in my module?

I used same as below in my module

$comment = $helper->__("Order status changed to: %s", $newState);
$order->setData('state', $status);
$order->setStatus($order->getConfig()->getStateDefaultStatus($status));
$history = $order->addStatusHistoryComment($comment, false);
$history->setIsCustomerNotified(true);
$order->sendOrderUpdateEmail(true, $comment);
$order->save();


texts: Magento 2: preference not working in admin panel

texts:
I am trying to override ConfigurablePriceResolver but can't override

app/code/vender/module/etc/di.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver" type="Vender\Module\Pricing\Price\ConfigurablePriceResolver" />
</config>

app\code\Vender\module\Pricing\Price\ConfigurablePriceResolver.php

<?php

namespace Vender\Module\Pricing\Price;

class ConfigurablePriceResolver extends \Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver
{

    /**
     * @param \Magento\Framework\Pricing\SaleableInterface|\Magento\Catalog\Model\Product $product
     * @return float
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function ResolvePrice(\Magento\Framework\Pricing\SaleableInterface $product) {
        $price = null;
        foreach ($this->configurable->getUsedProducts($product) as $subProduct) {
            $productPrice = $this->priceResolver->resolvePrice($subProduct);
            $price = $price ? min($price, $productPrice) : $productPrice;
        }
        /* if (!$price) {
            throw new \Magento\Framework\Exception\LocalizedException(
                __('Configurable product "%1" do not have sub-products', $product->getName())
            );
        } */
         return $price === null ? null : (float)$price;
    }
}


texts: Re-save all products in Magento2 - Weird error has forced me to manually resave products to get configurable options to show up on frontend

texts:
I can't find any information on how to programmatically re-save all products.

I'm running into a weird error that suddenly all products with configurable options, the options no longer show up on the frontend unless I manually go into the backend and click save on the product.

I have over 1000 products so it would be really helpful if I could get a script working to programatically re-save all products so that their options show up on the frontend again.

Things I have already tried:

reindex all by php bin/magento indexer:reindex
cleared all cache etc
redeployed static assets
ran php bin/magento setup:upgrade etc...

If someone could convert this logic to Magento 2 that would be soooo helpful and save me probably 10 hours of work:

http://magetechno.com/wpmaster/resave-all-products-in-magento/

  "Due to index problem in Magento which causes the product information
  isn’t shown correctly on frontend. You will have to resave the product
  to have correct data again. But there are a lot of products you can do
  it manually. Here is script to help you to save all products quickly.

  Step 1 : Create file named “resaveallproduct.php” in root folder of
  magento. Step 2 : Paste following code."

// require magento core
require_once 'app/Mage.php';

// execute on admin store
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')->getCollection();
foreach($products as $product) {
    echo $product->getName() . '<br/>';
    // save the product
    $product->save();
}

echo 'Congratulations!!! Product resaved';
?>

  Step 3 : Now run “resaveallproduct.php” file from broswer. For Example
  : yourdomain/resaveallproduct.php

I need the above code basically to work for magento 2, or any other type of workaround.

Please help!


texts: I was wondering if anyone out there could lead me to a good Magento shipping module that would allow the shop owner to use FedEx, UPS, and/or USPS, and more specifically use there FedEx account number so that they can charge their own shipping rates negotiated by FedEx.


texts: On the generic order confirmation emails that are sent out after a customer places and order, how do I go in and changed the email address for customers with questions to contact us? Right now it's support@example.com. This needs to change.


texts: Not able to update(single or bulk) product attributes after doing a bulk import in M2.3.4

texts:
I had uploaded some products using import option in my M2.3.4 site hosted on web-server. Now when i need to change/update some attributes - i cannot do that as i can't save my changes. I have been going through various posts but i cannot come to a solution.
My crons are running fine. I did a ps aux |grep [c]onsumer & the results are;

> gadgetwi  614593  0.1  0.0 517400 94428 ?        S    13:51   0:01
> /opt/alt/php72/usr/bin/php /home/gadgetwi/public_html/bin/magento
> queue:consumers:start product_action_attribute.update --single-thread
> --max-messages=10000 gadgetwi  614596  0.1  0.0 517400 94424 ?        S    13:51   0:01 /opt/alt/php72/usr/bin/php
> /home/gadgetwi/public_html/bin/magento queue:consumers:start
> product_action_attribute.website.update --single-thread
> --max-messages=10000 gadgetwi  614598  0.1  0.0 517396 93472 ?        S    13:51   0:01 /opt/alt/php72/usr/bin/php
> /home/gadgetwi/public_html/bin/magento queue:consumers:start
> exportProcessor --single-thread --max-messages=10000 gadgetwi  614600
> 0.1  0.0 517400 93604 ?        S    13:51   0:01 /opt/alt/php72/usr/bin/php /home/gadgetwi/public_html/bin/magento
> queue:consumers:start codegeneratorProcessor --single-thread
> --max-messages=10000 gadgetwi  655587 17.5  0.0 501876 78844 ?        R    14:07   0:00 /opt/alt/php72/usr/bin/php
> /home/gadgetwi/public_html/bin/magento cron:run --group=consumers
> --bootstrap=standaloneProcessStarted=1 [gadgetwi@webhosting2042 public_html]$ php bin/magento queue:consumers:start exportProcessor

One observation: when i run (php bin/magento queue:consumers:start exportProcessor) in CLI - i get no results. Basically nothing happens.
Most of the solutions provided by people earlier revolve round cron and in my case i don't know how to fix it. The basic ones like max-message = 10000 is already in place.

Any insights into my issue would be much appreciated.

thanks
Harish


texts:
I want to show loading spinner on certain action, like click on particular button will show loading image on the screen.

I know default functionality exist for magento 2. but don't know how to enable it on certain button click.

Thanks


texts:
I have developed one module for old magento versions and now I have developed the same module for Magento 2.

Now, I want to upload this magento 2 module in magento community. I have prepared the required zip file to be uploaded in magento community.

Can anyone help me to do this after this step?


texts:
I created my module for GeoIP where I get location based on IP and set currency and stores according to It.

I have implemented the login in the first possible observer controller_action_predispatch to initiate this logic.

$currentIp = $this->_remoteAddress->getRemoteAddress();
$currency = $this->getCurrency($currentIp);
$this->_storeManagerInterface->getStore()->setCurrentCurrencyCode($currency);

The above implementation is just an sample of what I am doing and it works great.

However when implementing varnish in my server my logic fails. Now My question is I dint find any solution to make observer cacheable false as cacheable false works for blocks I guess. Even though I may get a solution to make it cacheable false will varnish implantation be logical as my observer will be called every time and I will get my page as miss.

What can I do to overcome this?


texts: Google Analytics tracking and reports per each store view

texts:
I'd want to have different reports for each store view in a single Magento store, if I add a different GA tracking code in each store view (e.g. ITA, ENG, FRA) this could make sense? According your experience this method will work properly?
And where is the best place to add the GA tracking: Configuration->Google API or enter directly the scripts in Design->HTML Head?


texts:
In my Magento shop, i have a form, witch send the information via email to me, and recently there have ben a lot of spam from that form (70 since yesterday).

Is it posible, to get a secure form in magento, witout using CAPTHA? :)


texts: Add a template file to cms page Magento 2

texts:
How can I add a template file located under:
app/code/design/Smartwave/porto_child/Qx/Verkoopje/templates/laptop.phtml

Into a cms page?

I use the following code but it does not work

{{block class="Magento\Framework\View\Element\Template" name="verkoopje" template="Qx_Verkoopje::laptop.phtml"}}


texts:
I am Having problem to make custom option dependable . I am having two custom option. In First i have 3 radio button and in second i have drop down . What i need to do is that when i select 1 radio button ,i need to display the drop down and for the rest of radio button hide that drop down. And Also one suggestion is required is that is it possible to import the dependable custom option with csv file if i use dependable custom option module(import custom option template using magmi).
Thank you


texts: how to check if product belongs to particular category?

texts:
I want to check if product belongs to particular category then that product should be stored in that newly created category named folder.

I tried this code:

$productCollection = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category);
$cats = $productCollection->getCategoryIds();
foreach ($cats as $category_id) {
     $_cat = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($category_id);
     $catname = $_cat->getName();
     if (count(array_intersect($catname == 'Camera',$productCats))) {
         $dispretionPath='/Camera';
     } else {
         $dispretionPath='/images' ;
     }
}

--edit--

I tried this code but it is not creating folder

$product = Mage::getModel('catalog/product');

$cats = $product->getCategoryIds();
foreach ($product as $products) {
   if (array_search($category_id == 3,$products) === false ) {
    $dispretionPath='/Camera';
}else {
            $dispretionPath='/images' ;
        }
}
return $dispretionPath;

Any solution?


texts:
I am using the tutorial here http://alanstorm.com/layouts_blocks_and_templates
which outlines out to create a new blank admin page with a link in the nav bar.

That all works good and fine. However I am now trying to make a phtml page for all the html content instead of just having a blank page.

However what is happening is I am still getting the blank page. I see the admin header/nav and footer of the admin panel but no middle content.

Below is my code
app/code/community/Pulsestorm/Adminhello/etc/config.xml

  <?xml version="1.0"?>
<config>
<modules>
    <Pulsestorm_Adminhello>
        <version>1.0.0</version>
    </Pulsestorm_Adminhello>
</modules>
    <admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Pulsestorm_Adminhello after="Mage_Adminhtml">Pulsestorm_Adminhello</Pulsestorm_Adminhello>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

<global>
    <helpers>
        <pulsestorm_adminhello>
            <class>Pulsestorm_Adminhello_Helper</class>
        </pulsestorm_adminhello>
    </helpers>
</global>

<adminhtml>
    <layout>
        <updates>
            <adminhello>
                <file>samplecustomerslist.xml</file>
            </adminhello>
        </updates>
    </layout>
</adminhtml>
</config>

app/design/adminhtml/default/default/layout/samplecustomerslist.xml

  <?xml version="1.0" encoding="utf-8"?>
  <adminhtml_adminhello_index>
      <block type="core/template" output="toHtml" name="templateBlock" template="template/samplerequests/samples_customer_listing.phtml">
  </adminhtml_adminhello_index>

I then have a phtml file that just says hello world which is located at
app/design/adminhtml/default/default/template/samplerequests/samples_customer_listing.phtml

So what am I missing?

What should my config.xml look like? Below is my full config.xml which does not seem to make my phtml file load.

<?xml version="1.0"?>
<config>
  <modules>
     <Pulsestorm_Adminhello>
        <version>1.0.0</version>
     </Pulsestorm_Adminhello>
 </modules>
 <admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Pulsestorm_Adminhello after="Mage_Adminhtml">Pulsestorm_Adminhello</Pulsestorm_Adminhello>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

<global>
    <helpers>
        <pulsestorm_adminhello>
            <class>Pulsestorm_Adminhello_Helper</class>
        </pulsestorm_adminhello>
    </helpers>
</global>

<adminhtml>
   <layout>
        <updates>
            <pulsestorm_adminhello module="pulsestorm_adminhello">
                <file>samplecustomerslist.xml</file>
            </pulsestorm_adminhello>
        </updates>
    </layout>
</adminhtml>
</config>


texts:
How would I rewrite Magento deducting from stock levels from when a product is purchased?

I am guessing I would need to rewrite app/code/core/Mage/CatalogInventory/Model/Stock/Item.php but not too sure


texts: Magento2 set "in stock" when programmatically update qty

texts:
I use this code to programmatically update the stock but status remain "out of stock". How to force Magento to set "in stock" when qty change from 0 to 1 or more ?

foreach($importArray as $line){ // pour chaque ligne
  $line = trim($line);
    $line = str_replace('"','',$line);
    $line = explode(';',$line);

  $sku = $line[1];
  $stockValue = $line[2];

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $product = $objectManager->get('Magento\Catalog\Model\Product');
    $stockRegistry = $objectManager->create('Magento\CatalogInventory\Api\StockRegistryInterface');

    if($product->getIdBySku($sku)) {
        $stockItem = $stockRegistry->getStockItem($product->getId());
        $stockItem->setData('qty',$stockValue); //set updated quantity
        $stockRegistry->updateStockItemBySku($sku, $stockItem);
    }

};


texts: custom js/css file not getting called through phtml- 404 error

texts:
Im trying to creating a custom js file in my custom module.

This is what i have tried.

\view\frontend\requirejs-config.js

var config = {
map: {
    '*': {
        test:  'Vendor_Module/js/test'
       }
     }
};

\view\frontend\layout\default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">

     <link src="Vendor_Module::test.js"/>
     <css src="Vendor_Module::test.css"/>

</page>

\view\frontend\web\js\test.js

Here i have few functions already in test.js, but need suggestion here as to how to proceed.

I have done as follows.How to proceed here!

define([
'jquery',
'jquery/ui'
], function($){
 $.widget ('mage.test',{
    _create: function() {
        if (console) {
            console.log(this.element);
        }
    }
});
 //return $.mage.test;
//});

function extend(t, e){

 ...}   // should the extend() be within the function($){..} ?

Im calling my js thru html as :

view\frontend\templates\js.phtml

I get this error! Which says my js is not loaded, is the way what i have called from js.phtml rite?


texts: Cannot gather stats and Invalid template file after installing Porto theme

texts:
After setting up Magento 2 in developer mode, I am getting a couple of errors:
[2021-04-19 21:39:09] report.INFO: Broken reference: the 'yotpo_bottomline' tries to reorder itself towards 'product.info.addto', but their parents are different: 'product.info.main' and '' respectively. [] []
[2021-04-19 21:39:09] report.CRITICAL: Cannot gather stats! Warning!stat(): stat failed for /app/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Cannot gather stats! Warning!stat(): stat failed for /app/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js at /app/vendor/magento/framework/Filesystem/Driver/File.php:95)"} []
[2021-04-19 21:39:10] report.CRITICAL: Invalid template file: 'owl_list.phtml' in module: 'Smartwave_Filterproducts' block's name: 'home\featuredlist_0' {"exception":"[object] (Magento\\Framework\\Exception\\ValidatorException(code: 0): Invalid template file: 'owl_list.phtml' in module: 'Smartwave_Filterproducts' block's name: 'home\\featuredlist_0' at /app/vendor/magento/framework/View/Element/Template.php:280)"} []
[2021-04-19 21:39:10] report.CRITICAL: Invalid template file: 'grid.phtml' in module: 'Smartwave_Filterproducts' block's name: 'home\featuredlist_1' {"exception":"[object] (Magento\\Framework\\Exception\\ValidatorException(code: 0): Invalid template file: 'grid.phtml' in module: 'Smartwave_Filterproducts' block's name: 'home\\featuredlist_1' at /app/vendor/magento/framework/View/Element/Template.php:280)"} []

The file permissions for mixins.js are -rw-rw-r-- 1 root root 7375 Apr 19 17:01 mixins.js
owl_list.phtml and grid.phtml are both located in /app/app/design/frontend/Smartwave/porto/Smartwave_Filterproducts/templates/
I followed the Magento 2 documentation to install Magento in docker. Then, in an attempt to follow the Porto docs, I copied the Porto theme files, the theme patch for Magento 2.2.x, theme patch for Magento 2.3.x, and the theme patch for Magento 2.4.1.
Any help on resolving the above errors would be appreciated.


texts: Magento 2: Get product price from id? or sku?

texts:
Is there anyway I can display the price of a certain product by id or sku?

something like this piece of code:

$_product->getPrice();

But I need to be able to put a sku or id somewhere in that code to display a price of a product on another page.

*I need to be able to do it on a cms page


texts: After Newsletter Subscription,Confirmation Message Should be display on top instead of bottom on Home Page

texts:
How to move Success, Error messages position on top for home page only (others are already on top)?

I want to display  Newsletter Subscription Message on top instead of bottom for home page only.rest of the places it's showing on top.

this is manage from the following controller:-

Magento\Newsletter\Controller\Subscriber\NewAction.php::execute()

I also tried to do the same from JS but it's not working.when i directly hitting my JS code on browser console then it's moving the message on top but when i tried Magento2 way then it's not working.

Here is the JS code:-

subscribe-newsletter.js:-

requirejs(['jquery'], function($) {
    $(document).ready(function(){
            console.log("Hey123") ;
    $(".message-error").insertBefore(".feature_product");
    });
});

Path:- app/design/frontend/Smartwave/porto_child/web/js/subscribe-newsletter.js

layout cms_index_index.xml:-

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

Screenshot:- https://nimb.ws/jHrfZh

Please help me to resolve!!!


texts: How to setup Docker Image for Magento 2 on Mac Book?

texts:
I want to setup Docker for Magento 2.

I have gone through number of links but didn't find the solution yet. Can somebody share useful links to do this.

Thanks


texts: Magento 2.3: How to get tracking info from an order in observer

texts:
We use ShipStation to send tracking information to Magento and I'm trying to retrieve the order shipping / tracking information once this is saved to the order.

If I use sales_order_shipment_track_save_after for my event / observer, I can get the tracking information, however, it doesn't seem like this event is called when updated via ShipStation api.

If I change the event to sales_order_shipment_save_after, this gets triggered by ShipStation but it doesn't appear that I can get tracking information from this event.

Any ideas how I can get tracking information when it's updated via api from ShipStation?


texts:
admin -> Categories -> mycategory -> Display Settings

When I Full Width Layout -> Yes and Save the problem is not saved.

Can you help me with this?


texts: Magento 2.1 configurable product times out

texts:
Background
I do not think this is a bug but a server issue. When I create a large configurable product like a mattress that has 6 images for each of the 6 size configurations Magento only gets through about 4 products total before I get sent to a 404 page instead of back to the product page in the admin dashboard.

Thinking this may be because a server timeout or database timeout I have set PHP max execution to unlimited and my database to 360 seconds. This did not help though.

NOTE: I never made it to 360 seconds by the way. I get sent to the 404 page before that.

Question(s)

Has anyone resolved an issue similar to this before? Is this a bug in magento or am I correct in thinking it is a timeout issue?
What server settings should I be changing/ testing besides the 2 I did already?


texts: Modules that can be safely disabled that require 3rd party subscriptions

texts:
I'm just working my way through the latest update of 2.3.1. And as usual, I'm seeing some pre-installed modules that require subscriptions to 3rd party services in order to actually use them.

Such as (not sure if I missed any):

Engagement Cloud: dotmailer/dotmailer-magento2-extension
New Relic Reporting: magento/module-new-relic-reporting
Signfyd: magento/module-signifyd
Temando Shipping: temando/module-shipping-m2
Vertex: vertex/module-tax

I've done some initial checks such as:

Verify no circular dependencies: bin/magento info:dependencies:show-modules-circular
Disabling each module without seeing a dependency error message

But would like to know if anyone has run into any issues further down the line after disabling them.


texts: How to refer to no named block in Magento 2

texts:
I have block:

<block class="Magento\Backend\Block\Widget\Grid\Column" as="name">
    <arguments>
        <argument name="header" xsi:type="string" translate="true">Title</argument>
        <argument name="index" xsi:type="string">title</argument>
        <argument name="header_css_class" xsi:type="string">col-title</argument>
        <argument name="column_css_class" xsi:type="string">col-title</argument>
    </arguments>
</block>

I want to overwrite "header" argument without changing this block. I tried:

<referenceBlock name="name">
        <arguments>
            <argument name="header" xsi:type="string" translate="true">my value</argument>
        </arguments>
</referenceBlock>

but it is not working. When I added name="name" to original block, it worked. So how can I refer to original block without editing it?


texts: How to rename order shipments name in customer dashboard frontend?

texts:
I am using Magento 2.1
I want to rename order shipments name and switch order shipments first then invoice.


texts: Adding cart error to prevent going into the checkout

texts:
i have been working trying to create an edit order system where when an order is bellow a given state the customer can edit the order

now i have everything working by adding a reorder like link which does the exact same as reorder but creates a session which identifies that your editing an order, in order to do this for out of stock products i had to turn backorders on

however i have found a glitch, if a customer was to add 5 hats to the cart and logs off, if when they come back the item's stock qty is now 0 they can still go into the cart, naturally this is because of the backorders being enabled.

i have made a CartController to pick up adding/updates to the shopping cart and manually check if the stock is less than what's in the cart, however if the customer had the item when there was ample stock, leave and returns when it's now out of stock, they bypass these checks

one suggestion that was made by a college was that we shorten the lifetime of the cart session for registered customers, while we could do this, there is more of a problem during a sale

originally, before backorders was turned on, if this same situation occurred the "Proceed to checkout" button would be missing and you would get an error message

now i've tried fixing up a new IndexController and using $this->_getSession()->addError('Some products in your cart have gone out of stock'); but i'm not getting the same results

so how do i create an error message that will prevent the customer from going into the checkout until they have fixed up their cart


texts:
I have found on dev docs that REST API is recommended for mobile application.

I have created integration from magento admin panel and tried to access resources with passing access token in header. Getting products and categories list but with limited data only. Also generate guest cart and add product to cart for guest users are working fine. Then I have tried to delete one of product using access token and it got success. It seems security risk if use hard coded access token in app. Also, there is no option for defining resources operations access along with integration in Magento admin panel.

Dev docs provides information about access token authentication for registered customer account only. Is any way for guest user to generate access token dynamically with limited access for read only permission?

I am wondering how to use REST API correctly with mobile app.


texts: magento customer review submit event or other to filter out certain strings

texts:
I was browsing a Magento event cheat sheet because I was hoping to find an event: review submit save before ... and capture the title/name/text from the description. And set the review to deleted or dissaproved if certain strings are shown - like "href" or "http"
http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/

We are currently seeing so much spam in our review forms that a quick check for these two strings would filter out 99% ...

I would be hoping to turn this into a simple extension where keywords in the backend can be separated by commas and these are then looked for in the reviews

Question: is there such an event? and how would I go about capturing the values and check for the forbidden words


texts:
The scenario is as follows:

I sell unisex clothes. As a result I used a Gender attribute on the product page to allow the customer the option of seeing a male model wearing the item and a female model wearing the exact same item - the main image is interchangeable depending on switching the product attribute gender otherwise product is exactly the same. Ultimately, I am using an attribute for the sake of changing the image but not the product itself.

Other attributes include Size and Quantity only.

As is well known an SKU cannot be duplicated. My question is: Considering the above, what options are available to ensure alternative SKU's share the same inventory?

Or is there an alternative? Such as Bundles, that still allow the alternating main image on gender option change?

Thank you in advance,
A


texts: static block (created via admin panel) the same as a php Block class in a module?

texts:
Magento 2 related Question. Is a block(CMS Static Block) which I create via the Admin Panl, the same as a block which I created programatically in a module (app/code/Vendor/Module1/Block/Bla.php) ?

IF YES: In which folder is the static block(CMS Static Block) I created (via admin panel) located ? Where is the physical php class and the template and the layout XML file ?

IF NO: Where is the difference ?

Please Help I'm very confused. Any resource links are apreciated !


texts: How do I change the group of a custom product attribute?

texts:
I've created several custom product attributes like this:

$installer->addAttribute('catalog_product', $data['name'], array(
    'group'             => 'General',
    'type'              => $data['type'],
    'backend'           => '',
    'frontend'          => $data['front_end'],
    'label'             => $data['label'],
    'input'             => $data['input'],
    'source'            => 'eav/entity_attribute_source_table',
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'           => true,
    ));

Because I'm creating several attributes, the above code runs in a loop (hence the data variable).  I've copied the relevant portion (I think); there's several more fields being set, but I've excluded them for brevity.

I'd like to change their group to a custom one I've created in an upgrade script.  I'm able to set this correctly if I remove the module and recreate it.  However, I would like to be able to change the group through an upgrade script since the code has already been deployed.

I've tried this with no luck:

$installer->updateAttribute('catalog_product', $data['name'], array(
    'group' => 'Custom Product Tab'
));

How can I modify a product attribute's group in an upgrade script?


texts: new attribute disappeared from product page

texts:
Description is not shown in product page, after some changes it disappeared i don't know the reason. After this i create some new attributes but they also do not appeared in product page. As default only sku, price, short description is appear. The problem is in the front end, back end don't have any problem, everything is appeared in back end.

When i try to reindex, error appear "There was a problem with reindexing process""Cannot initialize the indexer process."
Please give me advice, thank you! magento 1.9


texts: Migrating All Product Images in Magento from PNGs to JPEGs

texts: As we have found our website is using PNG images and has page sizes ranging from 1 MB up to 2 MB sometimes, I did a comparison using small images.. and have found PNG size is 36 KB, while JPEGs with the same quality/size are just 6-7 KB. Since we have a lot products, is there an way to do such changes in bulk/automatically using a script or plugin?


texts: How to get Customers id through company name

texts:
Here is my code.

 $user_dataaa = Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('company',$row[3])->getData();
 echo '<pre>';print_r($user_dataaa);echo '</pre>';


texts: How to hide the custom shipping method only on the front end of Magento 2?

texts:
I saw several solutions but I couldn't implement them, I think I'm missing something. This method will be visible in the Magento backend and web service, not being an option visible in the cart.
I tried to disable using the Photocolor / MotoBoyPk / view / frontend / layout / checkout_index_index.xml file as below, but I don't know if this is right or if something is still missing.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="motoboypk" xsi:type="array">
                                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>


texts: Can someone tell me how to add a "shipment tracking" form in the sidebar?

texts:
I would like to have a tracking form to track the package.

I would like to have that form in my sidebar.

This is how it works

Track your package form -> User inputs order Id -> Popup appears with tracking content

Can someone tell me how to implement that?


texts: Magento 2 how to export stores, websites and store views?

texts:
I have a Magento installation with many websites, stores and store views, each website with it's own configuration for Shipping Methods, Payment methods, categories, etc..
I need to constantly move the stores to stage and prod environment, how can I achieve this?
Are there some tables in database that contain this information? at least the Websites, Stores and Store views.
So I can mysql dump the tables and import them.
Thanks and greetings!


texts: magento 2 how to enable google recaptcha wishlist popup

texts: I have enable google recaptcha in magento 2.but i need to display google recaptcha in wishlist popup form how to acheive it?


texts: Incorrect product count in layered navigation filter while sort using custom collection

texts:
I have an issue with layered navigation filter count. I have changed the product collection of sort, everything is working fine except the product count. Can anyone help.

Toolbar.php

class Andrw_Catalog_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
{
    public function setCollection($collection)
    {
    parent::setCollection($collection);

    if ($this->getCurrentOrder()) {
        //echo $this->getCurrentOrder();
        if($this->getCurrentOrder() == 'price_desc') {
            $this->_collection->setOrder('price','DESC')->getSelect();

        }
        if($this->getCurrentOrder() == 'price_asc') {
            $this->_collection->setOrder('price','ASC')->getSelect();

        }
        if($this->getCurrentOrder() == 'position') {//'relevance'

            $this->_collection->getSelect()
            ->joinLeft(
                array('sfoi' => $this->_collection->getResource()->getTable('sales/order_item')),
                'e.entity_id = sfoi.product_id',
                array('qty_ordered' => new Zend_Db_Expr('SUM(sfoi.qty_ordered)'))
                )
            ->joinLeft(
                array('si' => $this->_collection->getResource()->getTable('cataloginventory_stock_item')),
                'si.product_id = e.entity_id',
                array('instock' => 'si.is_in_stock')
                )
            ->joinLeft(
                array('_table_views' => $this->_collection->getResource()->getTable('report_viewed_product_aggregated_monthly')),
                '_table_views.product_id = e.entity_id',
                array('views' => new Zend_Db_Expr('SUM(_table_views.views_num)'))
                )
            ->group('e.entity_id')
            ->order(array('instock DESC','qty_ordered DESC','views DESC'));

        }
   }
}

Collection.php

class Andrw_Catalog_Model_Resource_Product_Collection extends
Mage_Catalog_Model_Resource_Product_Collection
{
    protected function _getSelectCountSql($select = null, $resetLeftJoins = true)
  {
   $this->_renderFilters();
   $countSelect = (is_null($select)) ?
       $this->_getClearSelect() :
       $this->_buildClearSelect($select);

   if(count($countSelect->getPart(Zend_Db_Select::GROUP)) > 0) {
       $countSelect->reset(Zend_Db_Select::GROUP);
   }

   $countSelect->columns('COUNT(DISTINCT e.entity_id)');
   if ($resetLeftJoins) {
       $countSelect->resetJoinLeft();
   }
   return $countSelect;
}
}


texts: how to detect if the product is on discount via a catalog price rule magento 2?

texts: I want to check Catalog price rule applied Configurable products or not on a listing page.


texts: Filter a collection with a custom attribute

texts:
I'm trying to add a custom attribute to the customer_entity table and then sort the collection with that custom attribute.
So far I've tried using etc/db_schema.xml to add a column to the table, and even though the column got added to the table, $collection->addAttributeToFilter('my_custom_attribute', '1') returned 'attribute 'my_custom_attribute' is invalid'.
I then tried to create a data patch, following various example online, to add an eav attribute. Here's my patch :
<?php

use Magento\Customer\Model\Customer;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchInterface;

class AddMagasinAttributeToCustomer implements DataPatchInterface
{
    /** @var ModuleDataSetupInterface */
    private $moduleDataSetup;

    /** @var EavSetupFactory */
    private $eavSetupFactory;

    /**
     * @param ModuleDataSetupInterface $moduleDataSetup
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        EavSetupFactory $eavSetupFactory
    ) {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public static function getDependencies()
    {
        return [];
    }

    public function getAliases()
    {
        return [];
    }

    public function apply()
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);

        $eavSetup->addAttribute(Customer::ENTITY, 'magasin', [
            'type' => 'int',
        ]);

    }
}

Now the eav attribute is present in the customer_eav_attribute table. I updated some customer data with the custom attribute value set to 1, but now, $collection->addAttributeToFilter('my_custom_attribute', '1') returns an empty array.
I have dumped the value of the corresponding record without any filter and the custom attribute value is set in the table.
What am I doing wrong here ?


texts: Magento 2.1.7 - Translating the wrong input messages on creating account

texts:
So we have a registration form with the fields Email, Password and Confirm Password as you can see in the picture:

What happens is that the messages which appear once the input has been written keep being showed in English after changing the language to Spanish:

I have modified the: <vendor>\app\i18n\<module>\es_ES\es_ES.csv file:

"Please enter the same value again.","Por favor, ingrese el mismo valor."
"Please enter a valid email address (Ex: johndoe@domain.com).","Por favor, ingrese una dirección de correo electrónico válida. (Ej: johndoe@dominio.com)."
"Minimum length of this field must be equal or greater than %1 symbols. Leading and trailing spaces will be ignored.","La longitud mínima de este campo tiene que ser igual o superior a %1 símbolos. Los espacios iniciales y finales serán ignorados."

As far as I have understood, about the .csv columns is that if I only write the first 2 (the old translation and the new one), it applies everywhere it finds it. And I did search the sentences in the vendor folder and the email sentence comes from a translation csv but I could only find the other 2 sentences in javascript files.

After changing all this I ran the below commands:

rm -rf pub/static/*;
php bin/magento setup:upgrade; php bin/magento setup:static-content:deploy; php bin/magento setup:static-content:deploy es_ES;

I also know and read about that both files:

app/design/frontend/vendor/theme/i18n/en_US.csv
app/design/frontend/vendor/theme/i18n/es_ES.csv

Don't have priority over(Atleast in my version):

app/i18n/...

I've read aswell some info about javascript translation but I don't understand it because i don't know about it.


texts: Setting meta title doesn't work (getMetaTitle() returns null)

texts:
When I set the meta title, both on product and category, the title in the Header is not changing. Then I tried to manually change the function in the header.php to getMetaTitle() but it returns null everytime.

What could be the problem?


texts:
This is my composer code , I do now know why I am getting unknow module error.
Please let me know

{
      "name": "nwt/base",
      "description": "NWT Base module",
      "type": "magento2-module",
      "version": "1.0.8",
      "license": "NWTCL 1.0",
      "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/magento-composer-installer": "*"
      },
      "autoload": {
        "files": [ "registration.php" ],
        "psr-4": {
          "NWT\\Base\\": ""
        }
      }
    }

Here is registration.php, I did all thing , cache clean , flash etc , but error is comming

<?php

/**
 *
 * @category    NWT
 * @package     NWT_Base
 * @copyright   Copyright (c) 2015 Nordic Web Team ( http://nordicwebteam.se/ )
 * @license     NWT Commercial License (NWTCL 1.0)
 *
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'NWT_Base',
    __DIR__
);


texts: Divide by Zero Error on a Bookstore template

texts:
I'm trying to work with a template on a bookstore site (M2.3.6). I added a new configurable product with 2 configurations and when I did, I got this error:
Error filtering template: Warning: Division by zero in /home2/crippenl/public_html/magento/app/design/frontend/Sm/amabook/Sm_RecentlyViewed/templates/slider-v2.phtml on line 101
The code is:

                                         getProductPrice($_product) ?>
                                        getPrice();
                                            $finalPrice   = $_product->getFinalPrice();
                                            $save_percent  = 100 - round(($finalPrice / $defaultPrice) * 100);

                                            if ($finalPrice

Any thoughts on this? I've been working on this for hours with no luck. Thank you.


texts: How to enlarge product images displayed through widget( product grid template)

texts:
I want to enlarge image size

I have inserted it through widget product grid template