texts: How to add Page URL link in footer magento2

texts:
I am trying to add new link in footer using CMS block and I know how to do that.first create new block in admin then go to your theme's layout->default.xml file and add below code so it will show link in Front end footer section.

<referenceContainer name="footer">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="Our Store">
            <arguments>
                <argument name="label" xsi:type="string">Our Story</argument>
                <argument name="path" xsi:type="string">Our Story</argument>
            </arguments>
        </block>
    </referenceContainer>

Now I have one problem is that which path I need to assign so when I click on this link it go to my Block's contain.

 <argument name="path" xsi:type="string">Our Story</argument>

on the above code what I need to specify or replace Our Story? so when I click on Our Story I go to this block's contain that I add in admin.right now I am getting 404 page not found.


texts: Magento 2 - How to add dynamic-row multiselect?

texts: This image what I already have. I have to make second column as multiselect. How to achieve this? This should be configuration field.


texts: Add the same product different times to an order in one step

texts:
It is possible, in Magento backend, to add different products to the order in one step: select the products, set the quantities, then add them to order at once. I always used simple products for this.

Anyway sometimes you have to specify product options. I have a few products with a custom text option. The text is always different: there are infinite possibilities and it depends by both the stock and the customer. I sell a lot of this items to the same customer.
To place an order from the backend I should:

click 'add products'
select the product,
specify the option
add the product to the order

(that is the usual flow), but then click 'add products' again, select the same product again, specify a different option, and so on.

I saw an ajax call made after third point (specify the option). Is there a way to show the duplicate the product in the search grid, to let me choose a new and specify a different option?


texts: Observer for invoice creation after it is saved

texts:
I have tried the following events for invoice creation observer:

sales_order_invoice_save_after
sales_order_invoice_pay
sales_order_invoice_register
sales_order_invoice_save_commit_after
controller_action_postdispatch_sales_order_invoice_save

and in the observer I am calling:
$invoice = $observer->getEvent()->getInvoice();
$invoice_id = $item->getData('entity_id');

For all of the above events, the entity_id is received as null. Also the observer is called before there is a new entry in the database.
What is the correct event to get invoice id after it is saved?


texts: How to change width in product view page?

texts:
I am converting my magento ecommerence theme into a theme more appropriate for a non profit organization, by removing all the features that appear related to an eCommerce shopping cart.   This is my product view page.  http://narsol.org/funding/narsol_events/nac2017reg.html

I need to tighten it up and center it.   Can someone tell me where to modify the code to change the width of the table?

Thank you.


texts: Rest API strategy for mobile app in Magento 2

texts:
I'm trying to create native mobile app for Magento 2 website.
It seems there is rest API in Magento 2 already. However, they don't seem to be designed for mobile app since most of essential APIs are not accessible from normal customer account (e.g. GET /V1/products requires Magento_Catalog::products)

I think there are two options to handle this problem.

Create admin account that has all permissions required, and use the token for non-anonymous APIs:
This seems simple, but there is potential security issue that malicious user may acquire the admin token and use it.
Define own API set, and add classes and functions which is safe to be exposed to customer: This needs more work apparently.

I wonder if there's better option that i'm missing.
And, I also wonder what is the purpose of Rest API even when customers cannot use those APIs.


texts:
I have code like below

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

I would like to know what will do

$this->loadLayout();
$this->renderLayout();

Actually I would like to know execution flow.

Thanks


texts: Magento 2 - Can't get order data in custom controller for payment gateway integration

texts:
I am developing a module for a payment gateway.

I created module skeleton using module creator provided here.
I used redirection solution given in this.
I wrote custom controller where it is getting redirect.

Now in my custom controller I need to create data to post on the payment gateway and then will post that data to the payment gateway url. Here I need order data which I and not getting in checkout session. I referred other extension they are using similar method but I am not getting any data.

protected function _getOrder()
{
if (!$this->_order) {

    $incrementId = $this->_getCheckout()->getLastRealOrderId();
    var_dump($incrementId);
    $this->_orderFactory = $this->_objectManager->get('Magento\Sales\Model\OrderFactory');
    $this->_order = $this->_orderFactory->create()->loadByIncrementId($incrementId);
}
return $this->_order;
}

protected function _getCheckout() {
    return $this->_objectManager->get('Magento\Checkout\Model\Session');
}


texts: Magento rating (stars) on store level, taken from product level

texts:
We are looking to find a magento rating (stars) on store level. One that also would provide a block with the stars, etc.

There are some examples out there. I have seen one with only text.

For the extension experts:

Is there an extension that supports ratings on a store level (stars)?
Possibly offering a block to show it + support for rich snippets
That would maybe take all product ratings, average it and show that as a total
And if you click on the block you see a page with all reviews in a nicely formatted list. With links to the product where the review came from

thanks


texts: M2 Custom Product Placeholder Image not showing on Stage or Prod server at Product Detail Level

texts:
I added an image to show images that aren't available (a placeholder) through the M2 admin. It is showing at the category level but not at the product level.

It works on my local machine  which is weird but on the staging and prod server it still shows the default Magento placeholder:

What's going on?
Any help is appreciated. Thank you!!!


texts: display product's custom image in custom email

texts:
Once Registered user upload custom image in product view page  & click on custom button "save design" , we are sending an email to customer. its working fine.

we are saving customer id, product name, custom image path in custom table : "my_designs"

but issue is Product image is not displaying in email.

<?php echo Mage::getModel('catalog/product')->load($this->getProductId())->getName() ?>
<image src="<?php echo $this->getValue() ?>">

we have preview to see all emails in backend, in preview product's custom image is displaying. but in email its not displaying.

side note : we are sending Abandoned cart email after customer click on "add to cart", in that email we are successfully custom image with help of below code :

<?php foreach ($this->getQuote()->getAllVisibleItems() as $item): ?>

<img src="<?php echo $this->getImageUrl($item->getProduct(), 100) ?>"/>

<a href="<?php echo $item->getProduct()->getProductUrl() ?>"><?php echo $item->getName() ?>

    <?php echo $this->getFormattedPrice($item->getPrice()) ?>

<?php if ($this->getQuoteImage($item)): ?>

    Your Design : <img src="<?php echo $this->getQuoteImage($item) ?>" />

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

Backend preview :


texts: Need to embed google translator in RTL arabic page

texts:
I need to embed google translator in RTL Arabic page, using magento 1.9.2.4.

Urgent response is highly appreciated.

Thank you


texts:
I confused by following collection classes

$orders = Mage::getResourceModel('sales/order_item_collection');

$orders = Mage::getResourceModel('sales/order');

$orders = Mage::getResourceModel('sales/order_collection');
Whats the  difference among those classes.

And whats difference between
Mage::getModel('sales/order');
and
 Mage::getResourceModel('sales/order');


texts: SOAP-ERROR: Parsing WSDL: Couldn't load from : failed to load external entity

texts:
Hi we are getting the following error

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://www.hourglassangel.com/api/v2_soap?wsdl=1' : failed to load external entity "https://www.hourglassangel.com/api/v2_soap?wsdl=1"

what could possibly be the reason for this SOAP error. Can anyone help us out with a solution ASAP.

Curlwrappers are already disabled.

ATTENTION:

As suggested, i checked out this post soap api : Start tag expected, '&lt;' not found'
I found that ini_set('display_errors',0); is already turned off. Still unable to overcome the SOAP error.


texts: Magento 2 : Priority of translation, proper way

texts:
I'm trying to set up a spanish-english store.

I have my dictionary that I want to reutilize for other stores. It has all translations in spanish. I install this dictionary on app/i18n/vendor/es_es/
At this point is all okay. I have standard translations so my store is on english-spanish.

But now, you install the template and customizations. Typical change is you want "wish list" instead of "add to wish list".

You can fix this easily creating i18n folder on theme folder and creating en_US csv file to customize all phrases you want.

But if you try to do the same on other languages, creating for example es_ES csv file, it won't take effect. Seems that on spanish it priorizes my dictionary.

To be clear, I have this 2 csv files on my theme:

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

The thing is, en_US.csv is working but es_ES.csv doesn't.

What can I do to priorize the translations on theme?

Or what is the proper way to achieve my objective? having a standard dictionary and then customizing some phrases.

I don't want to use inline-translations.


texts: Can multiwebsite setup slow down Magento2.3.2

texts:
Suppose if i have setup Magento 2.3.2 with default luma theme and created 40 around multiwebsite setup,
Can it slow down the performance of Magento2?


texts:
In shoping cart (checkout_cart_index). When I use bullet to increase qty then i use ajax to update cart.

After call ajax how to update cart summary.


texts:
I have newsletter_popup show each time visitors refresh page ?

<script type="text/javascript">
    require([
        'jquery',
        'mage/cookies',
        'jqueryfancyboxpack'
    ], function ($) {
        var check_cookie = jQuery.cookie('newsletter_popup');
        if(check_cookie == null || check_cookie == 'shown') {
            popupNewsletter();
         }

        jQuery('#newsletter-popup .subscribe-bottom input').on('click', function(){
            if(jQuery(this).parent().find('input:checked').length){
                var check_cookie = jQuery.cookie('newsletter_popup');
               if(check_cookie == null || check_cookie == 'shown') {
                    jQuery.cookie('newsletter_popup','dontshowitagain');
                }
                else
                {
                    jQuery.cookie('newsletter_popup','shown');
                    popupNewsletter();
                }
            } else {
                jQuery.cookie('newsletter_popup','shown');
            }
        });
    });

    function popupNewsletter() {
        jQuery(document).ready(function($) {
            $.fancybox.open('#newsletter-popup');
        });
    };
</script>

also I enable Cookie Restriction Mode in Magento Default Cookie Settings


texts: app/code/core/Mage/Core/Block/Abstract.php, where can I find this in magento 2?

texts:
where can I find this file in Magento 2?

app/code/core/Mage/Core/Block/Abstract.php


texts: Updating product stock status programmatically in Magento 2.3.x

texts:
I have been facing an issue lately, I want to allow some products to be added to cart and ordered (programmatically) even if they're Out of Stock, I have succeeded in updating both is_in_stock and stock_status but the product stock isn't updating right away, the changes only reflect when the page is reloaded.
This is the code I used to update and edit stock data
$product = $this->_productRepository->getById($childProduct->getId());

$product->setStockData([
           'stock_id' => 1,
           'use_config_manage_stock' => 0,
           'manage_stock' => 0,
           'is_in_stock' => 1
          ]);

$product->setQuantityAndStockStatus([
           'stock_id' => 1,
           'use_config_manage_stock' => 0,
           'manage_stock' => 0,
           'is_in_stock' => 1
          ]);

$product->setIsSuperMode(true);

$product->save();

die(var_dump($product->getIsSalable())); //Returns FALSE, however after refresh it returns TRUE.

Any help is appreciated!


texts:
In previous versions of Magento, I was able to use this code:

$product = Mage::getModel('catalog/product')->load(147);
$product->setDescription('test description');
$product->save();

However, in EE 1.13.1, I am getting a fatal error:

  Fatal error: Uncaught exception
  'Mage_Eav_Model_Entity_Attribute_Exception' with message 'Product with
  the 'louis-vuitton-handbag' url_key attribute already exists.' in
  /Applications/XAMPP/xamppfiles/htdocs/magentoee113/app/code/core/Mage/Core/Model/Config.php:1348
  ....

If I set the store ID when loading the product, then it works:

$product = Mage::getModel('catalog/product')->setStoreId(0)->load(147);
$product->setDescription('test description');
$product->save();

What is the proper way to do this?

Thanks.


texts:
How to get all value of Custom table with image

Table name : imguplaod column name : img


texts: magento orders are not tracked by google after upgrading universal analytics

texts:
After upgrading Googles Universal Analytics, magento orders are not tracked / converted.  We have checked the following options

added the track informations in
app/design/frontend/base/default/page/html/head.phtml
Sytem/Configuration-> Sales->Google Api -> Enabled and Account
number is given and
Ecommerce Tracking is on status in Google Analytics.  But the orders
not tracked by google.

we are using magento 1.7.  Shall we need to add any other things?


texts:
I know Magento requires good amount of resources for better performance.
But i wanted to know how much does an indexing process should take for a store that has around 22K products.

I have run indexing process via SSH and found the process is not completed due to lack of memory. I have already allocated 2GB, isn't this enough?

below is the output of indexing via SSH

 [~/public_html/shell]# php indexer.php reindexall
Product Attributes index was rebuilt successfully
Product Prices index was rebuilt successfully
Catalog URL Rewrites index was rebuilt successfully
Category Flat Data index was rebuilt successfully
Category Products index was rebuilt successfully
Search Index index was rebuilt successfully
Stock Status index was rebuilt successfully
Tag Aggregation Data index was rebuilt successfully
Improved Sorting index was rebuilt successfully
D2 - Search Terms to Category index was rebuilt successfully
D2 - Search Terms to Attributes index was rebuilt successfully

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 82 bytes) in /public_html/lib/Zend/Db/Adapter/Abstract.php on line 545

Can anyone please suggest me how much memory to allocate for such volume of store?


texts:
I add this in my controller, but if go to mysite.loc/module/controller/downloadPdf I show white window.

public function downloadPdfAction(){
        $this->getLayout()->createBlock('gent/orders_pdf')->setTemplate('gent/orders/pdf.phtml');
        $this->renderLayout();
    }

What I forgot to do?


texts: How to get product collection in magento 2

texts:
I am trying to create an API in magento 2 to get all product information. I have prepared a simple API module and it is working fine. Now I am trying to fetch product collection, but getting an error.

Here is my Code:

<?php

namespace CompanyName\Connector\Model;

    use Magento\Catalog\Model\Product;
    use CompanyName\Connector\Api\OdooInterface;
    use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollectionFactory;

    class Odoo implements OdooInterface
    {
        protected $productCollectionFactory;

        public function __construct(ProductCollectionFactory $productCollectionFactory)
        {
            $this->productCollectionFactory = $productCollectionFactory;
        }

        /**
         * Returns Product collection
         *
         * @api
         *
         * @return $collection
         */
        public function getProductCollection()
        {
            $collection = $this->productCollectionFactory->create();
            $collection->addAttributeToSelect('*');
            $collection->setPageSize(3); // fetching only 3 products
            return $collection;
        }
    }

Here is the error I am getting:

  Fatal Error: 'Call to undefined method Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor::getProductCollection()' in '/var/www/html/magento2/vendor/magento/framework/Reflection/DataObjectProcessor.php' on line 86

Please let me know, if any one have solution for it.


texts: How to display category image in topmenu navigation in magento 2

texts: I m using this extension for mega menu, i need to display a category image for every menu item.


texts: How to add new custom field to billing address section in magento2

texts:
I have tried to add new field in magento2 billing address section. I have followed below link to add new field in shipping address block

http://oyenetwork.com/articles/magento2-devliery-date-module-creation-from-scratch/

I have added new field to shipping address section successfully. But in my site, I have been using "Virtual products". So I want to add my new custom field into billing section. I just modified that "LayoutProcessorPlugin.php" code like below

  $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children']['payments-list']['children']['delivery_date']

instead of

  $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['delivery_date']

But it doesn't working. How to add my new custom field to Billing address block in magento2?


texts: what is the php variable names of the product attributes on the product page?

texts: I wonder what the name is of the different product attributes that are loaded on the product page. Is there somewhere where they are listed? And what about the custom ones. How can I figure out their name?


texts:
Hi I need to create a new attribute set in Products in which will contain a text area and an Image. How do I make it have an Add more button in which it will create another set of text area and image field? Thanks!

EDIT: I need to create a slider in which the contents will be coming from the backend. I need to have a text area for the description and an Image field to upload the Image for slider. The content manager should be able to upload as many as he wants so I cannot just create those attributes there hence I need to have some sort of an "Add more" button. (I need to create something like the uploading of images on products in where when you click "Upload Files" it will create another set of fields.)


texts: Magento 2 : create newsletter subscription CMS page

texts: do you have any reference that can share, how to create a CMS page that has a newsletter subscription form in it? I don't need an extra column for the data. Once the user subscribes there, it will automatically create a record at the newsletter subscription page, and also send a confirmation email to the subscriber, just like filling out the newsletter subscription box at all the pages.


texts:
In product view the more images titles are coming in admin value of the option label, I have 6 store views and how can I make the title of the more images to show the specific store view value of the label rather than the admin value?

title="<?php echo $this->escapeHtml($_image->getLabel()) ?>"

I have tried $_image->getStoreLabel()  and $_image->getFrontendLabel() but it didn't worked.


texts: Allowed country not working in magento2?

texts:
I have three stores (store A, B and C). All have different shipping destinations.

Under the website scope, I have set for Store A Japan for the Allow Countries.
And for Store B are non-eu countries (US, Canada etc) and for store C EU countries (UK, Germany etc).

However, at the checkout, all the allowed countries in the Default Config is listed.

How can I only show the allowed country in the website scope for the country option?


texts:
I want to implement a store with many small products that are usually bought in bulk (maybe 20-100 pieces at once). So I want to implement product "packs", i.e. a "pack of 10" alongside a "pack of 50". The packs should have different images and different pricing (i.e. a pack of 10 could cost 5$ and a pack of 50 only 20$).

So far I've been able to get close to my goal by using product attributes - I added a "size" attribute, and using a configurable product with product variations it's possible to achieve most of that behavior.

One issue remains with this approach though: I need to manage stock for the variations individually, while it'd be better to only keep track of one number (the total number of products in stock).

Is there any way to achieve this without coding that behavior myself? Any hints to get me started would be great.


texts:
Hi i need a two button in view page

Add to cart Product should be added into cart and it should not redirect to shopping cart
Buy now Product should be added into cart and It should redirect to Shopping cart

How to implement this?


texts: Magento 2: move the javascript to the end of the body

texts:
As Magento 2 migrated away from Prototype I was expecting that this would be fixed in M2.

So, is there a way (easy or not) to move all the <script> tags to the end of the <body> tag instead of the <head> ?


texts: Hello guys I am new to Magento system. I have a question. On my website when a user wants to click menu and submenu item he needs to tap on mobile phone two times. I want it to toggle when he clicks one time. Can you help me about this problem?


texts: How to change the generated "Meta Information" for a product?

texts:
I know that, when I enter the product manager, I have a section named "Meta Information" where  I can edit the product title, product keywords, and description.

My Question is: How can I customize the way such information is generated when the product is created? As far as I see, the default meta info generation for, e.g. categories, seem to be  , and that's one of many things I need to change.


texts: How to add programmatically product to wishlist in Magento 2?

texts:
I want to add the product to the wishlist in magento2.

What is the way to programmatically add the product into wishlist in Magento2?


texts: Protocol required error while installing magento 1.9

texts: Please help me to solve below error I am getting while installing Magento 1.9 in my local system (I think I have added the right URL only), it is so ridiculous :(


texts: Can't connect to database inside local container

texts:
I have my magento installation and a mysql server running in two local containers and I can successfully connect to mysql from magento's container using mysql -u root -p -h <mysql_container_ip> but I get a Port must be configured within host parameter error when trying to access my site. Here's my env:

'connection' => [
            'default' => [
                'host' => '<mysql_container_ip>:3306',
                'dbname' => 'magento2',
                'username' => 'root',
                'password' => '<password>',
                'active' => '1'
            ]
        ]


texts: Unable to get shopping cart data on Success.phtml

texts:
On the order confirmation page, I am trying to pull all the values of the items involved in the completed purchase, so they can be injected into a tracking iFrame. I found this code online, but it didn't work in my file for some reason:

    $objectManager = $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $cart = $objectManager->get('\Magento\Checkout\Model\Cart');

    //get quote items collection
    $itemsCollection = $cart->getQuote()->getItemsCollection();

    //get array of all items what can be display directly
    $itemsVisible = $cart->getQuote()->getAllVisibleItems();

    //get quote items array
    $items = $cart->getQuote()->getAllItems();

    foreach($items as $item) {
        echo 'ID: '.$item->getProductId().'
';
        echo 'Name: '.$item->getName().'
';
        echo 'Sku: '.$item->getSku().'
';
        echo 'Quantity: '.$item->getQty().'
';
        echo 'Price: '.$item->getPrice().'
';
        echo "
";
    }
    $block_methods = $item;

So then I tried to restart by simply assigning \Magento\Checkout\Model\Cart a variable name in two different ways:

$cart = get_called_class("\Magento\Checkout\Model\Cart");

and

$cart = get_class("\Magento\Checkout\Model\Cart");

but those methods both caused the page to freeze. Can anybody help explain what I am doing wrong?


texts:
if set "Privileged Customers" group for a customer, than ablity to add vouchers for this customer. Otherwise exception should be thrown with the next message "Customer isn't in a privileged group".
Model

public function createVoucherStatus($status)
    {
        $voucherStatus = $this->voucherStatusModelFactory->create();
        $voucherStatus->setStatusCode($status);
        try {
            $this->voucherStatusResourceFactory->save($voucherStatus);
            $response = ['idVoucherStatusCode' => ($voucherStatus->getId())];
            return json_encode($response);
        } catch (Exception $e) {
            throw new Exception("Status has code already");

        }
    }

Plugin

<?php

namespace Vendor\Voucher\Plugin;

use Exception;
use Magento\Customer\Model\CustomerFactory as CustomerModelFactory;
use Vendor\Voucher\Model\VoucherManagement as Subject;

class PrivilegedCustomer
{

    /**@var CustomerModelFactory */
    private $customerModelFactory;

    /**
     * @param CustomerModelFactory $customerModelFactory
     */

    public function __construct(CustomerModelFactory $customerModelFactory)
    {
        $this->customerModelFactory = $customerModelFactory;
    }

    public function aroundcreateVoucher(Subject $subject, $id, $callback)
    {
        $customerGroupId = $this->customerModelFactory->create()->load($id)->getGroupId();

        if ($customerGroupId = 4) {
            $callback();
        }
        throw new Exception("Customer isn't in a privileged group");

    }
}

But it giving back "message": "Plugin class Vendor\Voucher\Plugin\PrivilegedCustomers doesn't exist". I've  got red eyes already to reading manuals,but didn't fin solution


texts: Magento 2 : 404 page not found to see product after switch store to other store

texts:
I got 404 page not found after I switch English store view to German store view to see product.

  Note : It's display only in 3rd level category page.

How can I solve this?


texts:
I heve crontab * * * * * /bin/sh /home/mydomaindirectory/mydomain.com/www/cron.sh but cron doesn't work. Has error:

  /home/mydomaindirectory/mydomain.com/www/cron.sh: line 47:
  /home/mydomaindirectory/mydomain.com/www/cron.php: Permission denied

How can I fix it?


texts: Running an integration test doesn't create a new Magento Installation

texts:
When I read the documentation, it is my understanding that when I want to run an integration test, Magento should create a fresh new installation. So I copied install-config-mysql.php.dist to install-config-mysql.php with the proper credentials, the database exists, but as soon as I try to run the most simple integration test:

vendor/bin/phpunit \
    -c dev/tests/integration/phpunit.xml.dist \
    app/code/Vendor/Module/Test/Integration

... I get the following error (along with a huge stack trace):

Exception: Starting Magento installation:
File permissions check...
[Progress: 1 / 541]
Required extensions check...
[Progress: 2 / 541]
Enabling Maintenance Mode...
[Progress: 3 / 541]
Installing deployment configuration...
[Progress: 4 / 541]
Installing database schema:

[Zend_Db_Statement_Exception]
SQLSTATE[42S02]: Base table or view not found: 1146 Table
'magento_integration_tests.store_website' doesn't exist, query was:
SELECT `main_table`.* FROM `store_website` AS `main_table` ORDER BY
main_table.sort_order ASC, main_table.name ASC

Now, I could paste the stack trace but there is nothing useful there. That is: there is no reference to my own module whatsoever, nor to any 3rd party modules.

So does anyone have a clue why this happens? My best guess is that somewhere in the code the store table is already referenced prior before it is created (or Magento is installed at all for that matter).


texts: M2 observer: get custom customer attribute value (drop down)

texts:
I have created a custom customer select attribute (drop down). See below code.

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $attributeCode = 'custom_currency';

        $eavSetup->addAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, $attributeCode, [
           'type'=> 'varchar',
           'label' => 'Custom Currency',
           'input' => 'select',
           'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
           'required' => 0,
           'visible' => 1,
           'user_defined' => 1,
           'system' => 0,
           'position' => 120,
           'option' =>
                array(
                    'values' =>
                         array(
                             0 => 'EUR',
                             1 => 'CHF',
                             2 => 'CZK',
                             3 => 'PLN',
                             4 => 'DKK',
                             5 => 'NOK',
                             6 => 'SEK',
                             7 => 'GBP',
                             8 => 'USD',
                         )
                )
        ]);
        $eavSetup->addAttributeToSet(
          CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
          CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER,
          null,
          $attributeCode
        );
        $attribute = $this->eavConfig->getAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, $attributeCode);
        $attribute->setData('used_in_forms', [
           'adminhtml_customer',
        ]);
        $attribute->getResource()->save($attribute);
    }

In my Observer where I get my customer data I want to get the option value of this attribute too.

$customer = $observer->getCustomer();
$customCurrency = $customer->getCustomCurrency();

The code above only works when my attribute is an input field but not when its a select attribute, can anyone help?


texts: How to Upload Profile Picture with my REST API in magento2?

texts:
Hello I add one custom attribute of profile_picture to save the profile picture of customer but when i try to call the http://domain.com/ecommerce_app/rest/V1/customers API with following JSON Request:
{
 "customer": {
     "email": "abc1@gmail.com",
     "firstname": "Abc",
     "lastname": "Xyz" ,
     "custom_attributes": [
      {
        "attribute_code": "profile_picture",
        "value": {
            "base64EncodedData": "iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWtJREFUeNpi/P//P8NgBkwMgxyMOnDUgTDAyMhIDNYF4vNA/B+IDwCxHLoakgEoFxODiQRXQUYi4e3k2gfDjMRajsP3zED8F8pmA+JvUDEYeArEMugOpFcanA/Ef6A0CPwC4uNoag5SnAjJjGI2tKhkg4rLAfFGIH4IxEuBWIjSKKYkDfZCHddLiwChVhokK8YGohwEZYy3aBmEKmDEhOCgreomo+VmZHxsMEQxIc2MAx3FO/DI3RxMmQTZkI9ALDCaSUYdOOrAIeRAPzQ+PxCHUM2FFDb5paGNBPRa5C20bUhxc4sSB4JaLnvxVHWHsbVu6OnACjyOg+HqgXKgGRD/JMKBoD6LDb0dyAPE94hwHAw/hGYcujlwEQmOg+EV9HJgLBmOg+FMWjsQVKR8psCBoDSrQqoDSSmoG6Hpj1wA6ju30LI9+BBX4UsC+Ai0T4BWVd1EIL5PgeO+APECmoXgaGtm1IE0AgABBgAJAICuV8dAUAAAAABJRU5ErkJggg==",
            "type": "image/png",
            "name": "new_image.png"
        }
      }
    ]

 },

 "password": "Abc@123456"
}

I got the following error:
{"message":"Error occurred during \"custom_attributes\" processing. Attribute \"profile_picture\" has invalid value. The \"array\" value's type is invalid. The \"string\" type was expected. Verify and try again."}

Please help me how to fix this


texts: Magento : Template block has not been whitelisted error

texts:
I have a site with a CMS page using the 'core/template' block, and getting an error Security problem: core/template has not been whitelisted - even though the 'core/template' is clearly listed in the System > Permissions > Blocks list as 'Allowed' - I have cleared cache multiple times, turned the block permission on and off, and still no luck.

Anyone know about this solution?


texts:
Magento 1.9.0.1

2 store views: dutch & english

Does it automatically show the correct language based on browser settings?

or would I nee to do something like this: http://www.magentocommerce.com/wiki/multi-store_set_up/how_to_automatically_redirect_to_a_store_view_based_on_the_browser_language

Thanks


texts: Magento 2 - problem with mCustomscrollbar.js

texts:
Since few days i try to fix issue with my mCustomScrollbar plugin and i got stuck.

First of all i i've got library with mCustomScrollbar.js and mousewheel.js in

  web/js/mCustomScrollbar

and my script in

  web/js
  .

I added mCustomScrollbar.js and mousewhell.js to requirejs-config with path and shims.

My script looks like:

define([
    'jquery',
    'domReady!',
    'mCustomScrollbar',
    'mousewheel'
],
function ($, mCustomScrollbar) {
    'use strict';
    return function (config, element) {
        $(element).mCustomScrollbar({
            theme: 'dark'
        });
    };
}
);

The problem is - when i open page (where my script is applying) sometimes console shows

  Uncaught TypeError: $(...).mCustomScrollbar is not a function

and script doesn't work. Sometimes it works perfect. I don't know why it happens differently. When i open my page first time all looks good when i refresh - it depends, sometimes still works good (no errors, script applied) but sometimes doesn't work (with error above).

Can anyone tell me what wrong i do or why it happens differently?


texts: Assign Image Role to Multiple Products Images

texts:
I have added image role by using this code
namespace Vendor\Module\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;

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

    /**
     * {@inheritdoc}
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'attribute_image_code',
            [
                'type' => 'varchar',
                'label' => 'Image Attribute Name (Label)',
                'input' => 'media_image',
                'frontend' => 'Magento\Catalog\Model\Product\Attribute\Frontend\Image',
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'filterable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'sort_order' => 10,
                'required' => false,
            ]
        );
    }
}

Output:

Now I want to assign this role to multiple images but it only works for one Is there any way to assign it to multiple images .. ORRRR How can I add an option like Hide from Product Page checkbox


texts: Stop Magento creating URL Rewrites for Simple products

texts:
The website only shows configurable products but before the configurable product is created the simple products are created and URL Rewrites are created for the products automatically.

These simple products are not visible and do not need URL Rewrites.

If the configurable product has the same name as the simple products is will create a URL Rewrite with the ID at the end eg. product-4355.

I could create a script to empty the table and re-index but them any custom URL Rewrites will be deleted.

I have seen some similar post but they mention methods that work on magento 1.7 and wanted some advise whether anyone has had similar requests on magento 1.9

Any advice?


texts:
I am trying to get  Current Country Code Magento 1
using below code
$currentCountry = GeoIP_Core::getInstance(Mage::getBaseDir('media') . DS . "geoip" . DS . "GeoLiteCity.dat", GeoIP_Core::GEOIP_STANDARD)
            ->geoip_country_code_by_addr(Mage::helper('core/http')->getRemoteAddr());
    }

But its not giving me proper country code,
Is their any way to get it ?


texts: Purchase order carrier: show even if order amount is zero

texts:
We are setting up an B2B magento shop.

I want to make the purchase order form appear, even if the order amount is zero. So in fact there is nothing to pay but I'd like to display the form anyways.

How would I do that?


texts: Open Sans overwriting Lato ~ Magento 2.1

texts:
This question has not been answered anywhere else.  There is another post like this but it's not the same issue.

I have created a theme of my own, using Blank as the fallback. I have set Lato to be my default font.

I have set Lato in the CSS, on increasingly specific elements, with !important.

I have carefully gone through EVERY file in the site using DreamWeaver's excellent (and it's only useful) file search funtion, searching for occurences of both Open Sans and Open+Sans in the site files, and have found nothing outside of the dev/test folders that would affect my site.

I have refreshed the cache, and I have manually emptied the pub/*/frontend files.

And yet still, the fonts are clearly Open Sans and not Lato.

If I inspect the CSS file using Firebug, I have discovered this rule:

@font-face {
    font-family: "Lato";
    font-style: normal;
    font-weight: 300;
    src: url("http://www.XXX.co.uk/pub/static/frontend/XXX/ohc-dac/en_GB/fonts/opensans/light/opensans-300.eot?#iefix") format("embedded-opentype"), url("http://www.XXX.co.uk/pub/static/frontend/XXX/ohc-dac/en_GB/fonts/opensans/light/opensans-300.woff2") format("woff2"), url("http://www.XXX.co.uk/pub/static/frontend/XXX/ohc-dac/en_GB/fonts/opensans/light/opensans-300.woff") format("woff"), url("http://www.XXX.co.uk/pub/static/frontend/XXX/ohc-dac/en_GB/fonts/opensans/light/opensans-300.ttf") format("truetype"), url("http://www.XXX.co.uk/pub/static/frontend/XXX/ohc-dac/en_GB/fonts/opensans/light/opensans-300.svg#Lato") format("svg");
}

Which appears to show that the font in use is indeed called Lato, but it is using Opan Sans as Lato!?  But how is this possible?  I have completely emptied the pub/static/frontend folder a number of times, where is this cached font coming from?

It's driving me insane.


texts: Magento 1.9: How to limit collection for getPagerHtml?

texts: I want to limit the collection to display the page. For example, I search out 1000 products but want to limit to only 100 products.


texts:
I have a helper with this method to get the items in a customer's cart

public function getCartData()
{
    //Get cart DATA
    $quote = Mage::getSingleton('checkout/session')->getQuote();
    $cartItems = $quote->getAllVisibleItems();
    $items = '';
    foreach ($cartItems as $item) {
        $items .= $item->getId() . " ";
    }
    return $items;
}

But what I want to do is replace this line

$items .= $item->getId() . " ";

With an instance of template/checkout/cart/sidebar/default.phtml

How would I go about this?  The method is being called in an ajax controller.  I want to update the user's cart without a page refresh, but it needs to be formatted.


texts: Magento 2.4.2 : Add to Cart button is disabled on listing page

texts:
In Magento 2.4.2 "Add to Cart" button is disabled in template and is being enabled using js post initialization

vendor/magento/module-catalog/view/frontend/templates/product/list.phtml

<button type="submit"
    title="<?= $escaper->escapeHtmlAttr(__('Add to Cart')) ?>"
    class="action tocart primary"
    disabled>
    <?= $escaper->escapeHtml(__('Add to Cart')) ?>
</button>

vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js

_create: function () {
    if (this.options.bindSubmit) {
        this._bindSubmit();
    }
    $(this.options.addToCartButtonSelector).attr('disabled', false);
}

Can anyone help me with reason behind this approach? It wasn't there in Magento 2.4.1. Thanks in advance.


texts: we are getting order in magento site if customer don't pay in "payment[payumoney india]" site

texts:
we are using payu in our "MAGENTO" site :

payu is "payment method" in india as like paypal.

It's really strange that payu official code did't work well

after customer buy the product, than he went to "checkout" page ,

he click on "place order" button , after that it will redirect to "payu site"

he did't paid money but he can close the  payu site without paying, but than also we will recieve the "order".

we don't want this to be happen . in magento admin panel, we should get "order" only after customer paid the money in payu.

please help me to find solution.

thanks in advance.


texts: After Update product attribute, vanishes tier prices

texts:
I tried to update product's attribute called barcode as follows.

It update the product but cleared tier price of that product. Please help me.

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $prod_sku);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

if ($product) {
  $product->setBarcode($bar_code);
  if(! $product->save()){
            $productId = $product->getId();
            echo "product_Id :: ".$productId." - Product sku :: ".$product->getSku()."<br />";
        }else{
            echo "not saved";
        }
 }


texts:
I have a magento 2.0.15 installation which I want to replace with a fresh installation of latest version 2.2.2

I'm not able to upgrade existing version to the latest one. I checked data migration tool, but it only supports migration from 1.9.x to 2.x

Any ideas how to migrate data from one version to another?


texts: Magento FrontEnd Developer Certification

texts:
I want to apply for Magento Front End Developer Certification: https://magento.com/training/catalog/front-end-developer-certification

I found multiple sources, articles, exam simulations, etc. but they are older (1-3 years). How do I know which version of Magento will be used for this exam certification?
In the link above they don't specify this information.

From what I know at the end of 2015 was launched Magento2 but has many differences.


texts: Does layered navigation always have to use the configured search engine?

texts:
In Magento 2.1 custom search engines were introduced, so that MySQL could be replaced with ElasticSearch in EE.

My own search adapter works well in the search but now I realized that it is also used to fetch filters in layered navigation on category pages.

This leads to an error if my search result does not contain "buckets" for filterable attributes, like this:

Exception #0 (Magento\Framework\Exception\StateException): Bucket does not exist
#0 [...]/var/generation/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php(115): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->getFacetedData('style_bags')

While it makes sense to use the search adapter here, my problem is that it does it with the exact same method in Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection that is also used to fetch search results.

This does not work because I distinguish between attributes configured as filterable in search and as filterable in categories, so the normal search result does not contain the buckets that are needed on the category page.

I'll probably implement a switch based on the current controller, although that's not the cleanest solution.

But my question for now is: Is it really necessary to use the search engine in layered navigation or is there a way to fall back to the old method?

Update

It turns out that I get enough information in the $request parameter passed to the query method of my adapter implementation to figure out the context:

This makes at least a cleaner solution for my switch.

But when I try to fall back to the default MySQL adapter like this (with adapter injected as \Magento\Framework\Search\Adapter\Mysql\Adapter\Proxy):

if ($request->getName() === 'catalog_view_container') {
    return $this->mysqlAdapter->query($request);
}

there are errors in other places like Magento\Framework\Search\Dynamic\IntervalFactory where my adapter is still used based on di.xml and the system configuration.


texts: Page load issues from Magento Group Product Page request. Help Needed

texts:
We have roughly 3500 product simple products displaying on around 300 group product pages.
Some GP-pages have 2 associated products some have 50. The average is 11.6.

The majority of the associated simple products are not visible individually. Therefore their only existence is on this group product page. To improve the user experience we supply to the group product page more information by way of attributes than the default Magento Template.

We have 54 attributes, 5 not in use, 9 are created by us and of the remaining 40 default Magento attributes we use less than 25% of them.

All attributes are in the default folder.

Oddly prelaunch test showed no problems. After launch this issues began with some pages failing to load completely. As a bandaid we implemented a lazy load of the products by closing certain sub-category groups created by an original attribute on the page. This is far from acceptable and performance seems to be very inconsistent.

Using NewRelic we can see our issue is in the /catalog/product/view (86%)

What are we missing? Do we need to restructure our Attributes? If so by what factor?


texts: Magento 2.3 multilanguage error 404 with folder named as language suffix

texts:
Magento 2.3.5 multilingual site hosted on vps with plesk, I would like to create folders where to save the sitemaps of the site, where each folder must have the suffix of the language as its name. But if I create the folders then browsing the site I get Error 404.

The structure must be like: url "example.com/en",
folder with name "en", etc.

How can I avoid magento not recognizing the folder as a language suffix?

are there any special settings for magento or does it depend on .htaccess or the server?


texts: Magento 2.2.5 get product and product image urls store vise

texts:
I want to send all product data of my store into Elasticsearch. In that I am facing one challenge to retrieve product url and product image/video urls store vise.

For example:-

My default store URL :- https://localhost/magento2

My UK store URL :- https://localhost/magento2/ukstore

How can I get the all product url of ukstore which should look like https://localhost/magento2/ukstore/product1/.

Does anyone has any idea regarding this? Any help into this will be appreciated.

Thanks,


texts: Determine if customer is new in customer_save_after

texts:
I have events that I wish to execute when a customer registers or saves their details.  For this, I am using two events: customer_register_success and customer_save_after.  The problem I am having is that I end up running the task twice as customer_save_after is always called in the same execution as customer_register_success.

I have tried to detect whether the customer is new by checking the original data and called isObjectNew, but both return data that implies the object is in fact not new.  How can I check to see if the customer is just registering in the customer_save_after event short of setting something in the registry in the customer_register_success event?


texts: How to change a currency symbol in Magento

texts:
For a Magento with a Swiss franc as currency, the symbole for the german store is (FR.) i want it to be (CHF) instead.

In Magento this is declared in  lib/Zend/Locale/Data/root.xml

But i don't want to change this file, it seems like it's a nasty way (changin the Magento  Core), is there any other solution which allows me to change this symbole ?


texts: Change shipping source and calculate shipping based on the product

texts:
The problem :
I have two products A and B in cart. Two of them are shipped from different locations and thus i need to calculate shipping for these two products separately (with the source Zip as different). Which is the best way to do this?

I was thinking while the shipping is calculated remove one of the products and let magento calculate the shipping for product A. Then after the the shipping is calculated using and observer we send another request to fedex with the product B and the different Zip code as source.
I am not sure but i believe this is possible by observing the events sales_quote_address_collect_totals_before and  sales_quote_address_collect_totals_after . I am having trouble getting quote details in here , that's another story.

Or

Maybe split the order as in Split order into seperate orders and calculate shipping seperately with ups and fedex and different origin addresses
I understand this but unable to start somewhere on coding level.

Or is their even another easier simpler solution that doesn't include a paid plugin.

Only requirement calculate shipping for products shipped from two different locations.Also i am using onepagecheckout.


texts: How does translation scope work in Magento 2?

texts:
In Magento 1 different modules could provide different translations for the same string and the various __() methods in helpers and blocks always passed a module scope to the translator model, to determine which translation is used. In theme translations you could specify the module scope with translations like:

"Mage_Sales::Tax","Tax"

In Magento 2, one global function __() is used for translation and it seems to know nothing about the context where it is called:

function __()
{
    $argc = func_get_args();

    $text = array_shift($argc);
    if (!empty($argc) && is_array($argc[0])) {
        $argc = $argc[0];
    }

    return new \Magento\Framework\Phrase($text, $argc);
}

Does this mean there is no such thing as a module scope anymore? If so, what happens if two different modules define different translations for one string?

I'm thinking of ambiguous words like "state" that will be translated different depending on the context. How does Magento 2 deal with these?


texts: Magento 2 compile less files on staging server

texts:
I have a local repo with my Magento 2 development environment. I use
grunt watch to compile my local less files.
I push my edited less file with Git to my Beanstalk remote Develop branch
I deploy (pull) those commits with Beanstalk to my staging server, so my client is able to see my changes online.

But I don't see any changes? How do I produce my CSS (from my less files) on the staging server?


texts:
Good afternoon

About problem generating invoice via CRON on Magento

I am having the following problem in Magento

In digital product testing

If I perform the action of generating the invoice manually in the Backend works, the product is released for download

If I execute the action of generating the invoice manually via module by the controller works, the product is released for download

If CRON performs the action of generating the invoice via module does not work, the product is not released for download

I have isolated the test module in

We see the images of the processes executed in

http://tentaculos-biz.umbler.net/low_resolution_2017-02-28_17-35-39.pdf


texts: Get product applied price rule by product id in magento 2

texts:
Simply I want to get the rule_id or catalog rule details that is applied to a product in product details page and product listing page.

I have checked with this function _getRulesFromProduct() from magento-catalog-rule/Model/Rule.php but it return all catalog rule applicable for that product.

I want only one rule which is currently applied to that product.


texts:
I keep getting this error in system log:

  Invalid template file:
  'Inchoo_SocialConnect::inchoo/socialconnect/google/button.phtml' in
  module: 'Inchoo_SocialConnect' block's name:
  'inchoo_socialconnect_login_google_button' [] []

i also get these two main.INFO:

  Cache file with merged layout:
  LAYOUT_frontend_STORE1_2999a55d7d9f00b9a016b5e16762ce70a and handles
  default, customer_account_login: Please correct the XML data and try
  again.

  main.INFO: Cache file with merged layout:
  LAYOUT_frontend_STORE1_20a98983867a1770682b48d9a0ad63441 and handles
  1column: Please correct the XML data and try again.

snippet my layout file:

    <block class="Inchoo\SocialConnect\Block\Login" name="inchoo_socialconnect_login" template="Inchoo_SocialConnect::inchoo/socialconnect/login.phtml">
                <block class="Inchoo\SocialConnect\Block\Google\Button" name="inchoo_socialconnect_login_google_button" template="Inchoo_SocialConnect::inchoo/socialconnect/google/button.phtml"/>
    </block>

button.phtml file:

            <a href="<?php echo $this->escapeUrl($this->_getButtonUrl()); ?>"><?php echo $this->_getButtonText(); ?>

button.phtml gets called from login.phtml:

      <?php echo $this->getChildHtml('inchoo_socialconnect_login_google_button'); ?>

Test


texts: Magento 2: Add drag and drop image upload in custom module

texts: How can I add drag and drop image upload same as edit product page in custom module admin edit form instead of normal upload field.


texts: Magento 2 : Can not get Customer ID after Cache is enabled

texts:
I am Fetching CustomerId using

  public function getCurrentCustomerId()
    {

        return $this->_customerSession->getCustomerId();

    }

But After cache is enabled no id is returned (This was a known issue and was said to solved in Magento 2.1 but still facing the issue)


texts: How to translate Magento 2 My account page

texts: im trying to translate My Account page. I was looking for CSV file but did not find any. Could you help me with this please ?


texts:
I want to have all the JS outputted as it's in the HTML, so if the bundle, minify and CDN are enabled or not I would like to get the URL listed via my module.

How could I do that?


texts: Magento 2.2.2, Unable to unserialize value, magento_umask and edting Json.php did not help

texts:
After upgrade I'm getting below error in my local :

Exception #0 (InvalidArgumentException): Unable to unserialize value.

#0 myPath/vendor/magento/module-theme/Controller/Result/MessagePlugin.php(157): Magento\Framework\Serialize\Serializer\Json->unserialize('[{\\"type\\":\\"su...')

Tried solutions in below link but none of them helped :(

some solutions here


texts: How to add WYSIWYG functionality on my custom Magento 2 module?

texts:
Today I'm using the textarea to fields in my custom module, but I want to improve with the WYSIWYG.
How could I use WYSIWYG in a custom field in the admin configuration panel that my module creates?
Thanks


texts: I want to override the buttons.phtml in my module

texts:
I want to override the buttons.phtml file in my module can anyone help me out

please. For more info, please find the below screenshot


texts: Magento 2.1 - validate an admin auth token in external script

texts:
I need to use admin actions from an external script, currently i post username and password of the admin with every task , validate them, and then do the task.

Is there a way to use an authentication token instead?

that is post the token, and validate it in the external script

or even is there any way on how to validate the access token in a custom module?


texts: Restrict Payment Types by Admin Role or Customer group or rather by store?

texts:
I am trying to create a salesrep system for a customers store.
These salesreps have limited backend access and can create and edit customers and create orders for their customers as well as viewing their customers orders.

I now have the following issue:

Salesreps should be allowed different payment types than regular store users, but from the roles permissions I can't seem to allow this per role, nor per customer group (the samesrep creates an order on the customers behalf).

So I was wondering what is the best way to do this? Extend the payment type modules to be allowed by store view and use a 2nd store for the salesreps and allow / disallow the specific payment modules per store view, or write a module that checks for roles or customer groups before displaying the payment types?

/edit: Or maybe use Shoppingcart Rules, but I'm not sure these work when creating orders from the backend?

Any help is appreciated.


texts: Magento 2.2 Sending multiple order confirmation emails

texts:
Over the last couple of days our Magento 2.2 instance has been sending multiple copies of order confirmation emails to the customer. Sometimes as many as 10 identical emails received. Has anyone else experienced this, and ultimately found an answer?
We are using Swissup FireCheckout and MagePlaza SMTP module if that helps.


texts:
I can't see the magento orders. This error appears:

  a:5:{i:0;s:28:"Currency '39.7000' not found";i:1;s:4910:"#0
  /home/XX/public_html/app/code/core/Mage/Core/Model/Locale.php(614)

I checked the sales_flat_order table and I think that it's all ok. I don't know if there is another related table.


texts: Magento 2 Column search dependency in UI listing

texts:
Is there a way to make some listing select in filter to depend on some other select? I have seen this done on frontend checkout but that's a form not a list.

The idea is to make two columns searchable by select values but second select values are filtered by first option's value.

I tried something like this (similar to checkout implementation) but it does not work.

<column name="customer_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Module\Module\Model\Config\Source\Customers</item>
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">select</item>
            <item name="label" xsi:type="string" translate="true">Customer</item>
            <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
            <item name="dataType" xsi:type="string">select</item>
            <item name="dataScope" xsi:type="string">customer</item>
            <item name="sortOrder" xsi:type="number">75</item>
            <item name="sortable" xsi:type="boolean">false</item>
        </item>
    </argument>
</column>

<column name="address_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Module\Module\Model\Config\Source\Address</item>
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">select</item>
            <item name="label" xsi:type="string" translate="true">Address</item>
            <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
            <item name="dataType" xsi:type="string">select</item>
            <item name="dataScope" xsi:type="string">address_id</item>
            <item name="sortOrder" xsi:type="number">75</item>
            <item name="sortable" xsi:type="boolean">false</item>
            <item name="filterBy" xsi:type="array">
                <item name="target" xsi:type="string">${ $.provider }:${ $.parentScope }.customer_id</item>
                <item name="field" xsi:type="string">customer_id</item>
            </item>
        </item>
    </argument>
</column>


texts: LUMA no longer displaying menu/categories after upgrading to 2.2.3

texts:
I've just successfully upgraded from 2.2.2 to 2.2.3, and after which Luma no longer displays the menu / sub-categories or the logo on the main page of my website (www.seafordart.com.au), however when you click on a product it does display it correctly ..

Does anybody have any clue?


texts:
How to protect admin login with htaccess password in magento?

Can I add htaccess password restriction for the admin login only?


texts: Magento 2 Show timepicker using UiComponent not Datepicker

texts:
I want to show timepicker in my UiComponent form

As Magento Docs show the variations they provide timepicker :

I want this using UiComponent in my form.

  Note : Need to show schedule time so no date needed.

Checked reference :How to add time range picker to adminhtml form in Magento 2? (But its using block, I want using UiComponent)


texts: Just wondering the best practice for serving custom CSS files? File dir location for files as well as best way to link said files?


texts: Magento 2 search results suggest SQL commands

texts:
When i search some keywords like brand name XXX the search results suggest like following SQL commands
XXX' AND SLEEP(3) oRDeR BY 1 #
XXX" or (1,2)=(select*from(select name_const(CHAR(111,108,111,108,111,115,104,101,114),1),name_const(CHAR(111,108,111,108,111

I have Googled about it i see i am not alone:
https://www.google.com/search?biw=1920&bih=947&sxsrf=ALeKk01E6H2rZeNBTsgP5IBg5ubFXrUkNw%3A1601427042443&ei=YtZzX_fDGsOckwWRn4fgDQ&q=magento+AND+SLEEP%283%29+oRDeR+BY+1+%23&oq=magento+AND+SLEEP%283%29+oRDeR+BY+1+%23&gs_lcp=CgZwc3ktYWIQA1DG2Q1YxtkNYNDbDWgAcAB4AIABY4gBY5IBATGYAQCgAQKgAQGqAQdnd3Mtd2l6wAEB&sclient=psy-ab&ved=0ahUKEwj3_P3P1I_sAhVDzqQKHZHPAdwQ4dUDCA0&uact=5
Is it a bug? How can i clear these search suggets?


texts: Paypal Error: things don't appear to be working at the moment. Please try again later

texts:
We are using Magento 1.9.2.4. Suddenly we are facing issues with Paypal Standard payment method. Issue: https://prnt.sc/izpr57

Can someone help?


texts:
I'm beginning with Magento and it's incredible that create a theme is so complicated...

I've understand that to add my css to the head I need to override a layout. So I override default_head_blocks.xml with this content :

<?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>
        <!-- Add your own CSS files -->
        <css src="css/styles.css" />
    </head>
</page>

But this not works. Also after :
- ./bin/magento setup:upgrade
- ./bin/magento cache:flush && ./bin/magento cache:clean

Structure of my theme :


texts:
Firstly I export csv file from admin and keep only one row and delete the remaining row, after that I will change product name,category name and then import the file.I am getting the result in frontend. Similarly update the 52 rows of new category and product name, now stuck with one error

1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

note: here I am not upload image folder because I dont want to change image, in csv I just change product name and category.

I have checked file permission, its fine (755).

check data also give success message, import only the problem. I think its minor fix.

anything I did wrong? how to solve the issue?

Thanks in advance


texts:
Went to try and do some inline translations for a german store view I set up. I made a french store view at the same time.

While new to inline translations, I translated a block of text in the german store view last week to show test text.

When I go back to the german store view to enter the actual translated text, the block is no longer editable/translatable.. There is no red box around it with an option to select it for translation.

If I go to the french store view that has the same block at the footer, it is readily available for translation.

--

Because the native english text for that block was already 'translated' to display test content, does this mean once you inline translate (or enter any text) something, you can't translate it again to different text?

How can I get around this? Appreciate your help.


texts: Override module-contact view and controller

texts:
I created a new page with the CMS. I paste this in editor:

  {{block class="Magento\Contact\Block\ContactForm" name="contactForm"
  template="Magento_Theme::html/contact_form.phtml"}}

Then I overrided the contact_form.phtml successfully for my theme under

  app/design/fontend/MyThemes/2016/Magento_Theme/templates/html/

Submitting the form send to this controller vendor/module-contact/Controller/Index/Post.php

Route used in this controller is $this->_redirect('contact/index'); which is not the page I created with the cms.

My Question now is, how to override the controller?

I tried by creating the file under app/code/module-contact/Controller/Index/Post.php, but no success.

<?php
namespace Magento\Contact\Controller\Index;

class Post extends \Magento\Contact\Controller\Index
{
    public function execute()
    {
        die('pass here?');
    }
}


texts: Static content deploy generate thousands of weird folder names

texts:
i've run setup:static-content:deploy -f and now i'm getting a lot of strange folders on my pub/static/frontend folder For example one folder has the name "G7oLVFdw'; waitfor delay '0:0:6' -- " This folders arent "theme/language" folders.

Can someone please help me understand this?

Regards


texts: Slideshow disappearance after SUPEE-6788 patch

texts:
After installing SUPEE-6788 my slideshow has gone, it's enabled and added to the content, nothing was change on that end. All I did was FTP the SUPEE-6788 patch.

I added 6482 & 6285 refreshing each time to make sure everything still worked, is this a known issue with extensions?

I was using Dolphin_Slideshow 1.0.3

Thanks, Steve


texts: Is Wifi order printer available in magento 2?

texts:
Is there any paid/unpaid extension to print order automatically that are sent to my email : print@example.com via wifi/gprs printer ?

Also extension that supports wireless printers , suggestions required .


texts:
If I add the following to a category layout update, it successfully replaces the catalog/product/list template:

<reference name="product_list">
    <action method="setTemplate">
        <template>catalog/category/custom_view_list.phtml</template>
    </action>
</reference>

How can I also do this for the search results?


texts: Add text fields to Custom shipping Method

texts:
I have created a custom shipping method in magento 1.9.1 thanks to this tutorial.

That part was easy, Now I want to add a couple of text inputs (one is a shipping carrier and the other is an account no for that carrier) and a dropdown (showing multiple shipping plans) to this shipping method.
How do I display them in the frontend with this shipping method?
Do I do save this additional data in a new table or can I save them in the order?

What I need is some steps, guidance, not functional code.


texts: Is it possible to use UI Component with Custom Collection Data?

texts:
I'm trying to create an admin grid with custom data that comes from an array, i tried creating a Custom Collection using addItem method from \Magento\Framework\Data\Collection, but i'm kind of stuck on how i can make it work with UI Component listing in the admin.

Thanks!


texts: Magento 2: How to join product collection to custom table?

texts:
example: i have a table "table_1" i want to join product collection to get the product data? but I don't know how to join product collection? so everybody can help me pls?

List item


texts:
In magento 2.1.X, I am trying to append some text in my template file using a block within my custom controller. But i receive an error when doing so (my html markup is working just fine).

My block extends \Magento\Framework\View\Element\Template and my controller is kept basic for the moment as I will build a form with it.

in my template .phtml file, this is what i try to do

<section id="careers-section">
    <?php echo $this->__('test'); ?>
</section>

What have I done wrong?


texts: I got this error when click on add new item in Menu Items Manager in magento 1.9

texts: Warning: Missing argument 1 for Sm_Megamenu_Block_Adminhtml_Menuitems_Edit_Tab_Form::_getOrderByParentId(), called in /var/www/vhosts/websiteName.in/httpdocs/includes/src/Sm_Megamenu_Block_Adminhtml_Menuitems_Edit_Tab_Form.php on line 186 and defined  in /var/www/vhosts/websitName.in/httpdocs/includes/src/Sm_Megamenu_Block_Adminhtml_Menuitems_Edit_Tab_Form.php on line 532


texts:
I want to filter wishlist product collection with a unique id.
I have tried to override a method _createWishlistItemCollection located at the path /vendor/magento/module-wishlist/Block/AbstractBlock.php using preference method.

This is my di.xml file

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Wishlist\Controller\Index\Send" type="Vendor\Module\Controller\Index\Send"/>

    <preference for="Magento\Wishlist\Block\Share\Email\Items" type="Vendor\Module\Block\Share\Email\Items"/>

</config>

This is my block file

namespace Vendor\Module\Block\Share\Email;

    class Items extends \Magento\Wishlist\Block\Share\Email\Items
    {
        protected function _createWishlistItemCollection() {
            $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/testmulti.log');
            $logger = new \Zend\Log\Logger();
            $logger->addWriter($writer);
            $logger->info('Your text message');
            $collection = $this->_getWishlist()->getItemCollection();
            if($this->getMid()){
               $id = $this->getMid();
               if($this->getMid() == 'default')
                    $id = 0;
              $collection ->addFieldToFilter('multiwishlist_id', $id);
            }
            return $collection;

        }

    }

It is not entering into the overrided file. Plese help me with a solution.


texts: Auto generate SKU for products that do not have one in Magento 1.9

texts: Is it possible to generate skus for all products that do not have already one?


texts: After using custom url for admin panel, On error it redirects to the front end home page

texts:
I am creating new website and on exception rather than showing error message it is redirecting to the home page.
Expected result:

but redirecting to home page.


texts: Strange Looking Search Terms - Possible Malicious activity?

texts:
cbwV AND 2890=(SELECT
  UPPER(XMLType(CHR(60)||CHR(58)||CHR(113)||CHR(115)||CHR(111)||CHR(115)||CHR(113)||(SELECT
  (CASE WHEN (2890

Is just one of the terms, there are 10+ different ones cropping up, and being used every day. Are these something to be worried about? Is there a way to find out what the IP address is that has performed the search?

  cbwV%' AND (SELECT 7520 FROM(SELECT COUNT(*),CONCAT(0x71736f7371,(SELECT (CASE WHEN (7520=7520) THEN 1 ELSE 0 END)),0x7168707371

Is another. There are a lot of these, all different. If this is an attempted exploit, can someone point me in the direction of any docs/patch notes for this specific attack?

Regards


texts: Magento 2 : Edit Welcome Message For Logged Users

texts:
In template /Magento_Theme/templates/html/header.phtml I need change welcome message for logged users. Now it looks like:

<?php switch ($block->getShowPart()):
case 'welcome': ?>

        <span data-bind="text: new String('<?php echo $block->escapeHtml(__('Welcome, %1!', '%1'));?>').replace('%1', customer().firstname)">

<?php break; ?>

<?php case 'other': ?>
    <?php echo $block->getChildHtml(); ?>
<?php break; ?>

How I can get customer last name and gender. In the finally I want to have message:
Welcome, Man Jon Dough


texts:
I have 4 tables:
Animals
-- Race
---- Color
-------- Name

I know how I can load each table one by one but since the tables are related I want to load all elements and the whole hierarchy at once.

I tried loading in _afterLoad but this would result in executing many queries

Any help appreciated!


texts: Magento PWA: issue in starting development server

texts:
Followed all steps mentioned here (https://magento-research.github.io/pwa-studio/venia-pwa-concept/setup/) to install PWA-studio on my local.

All went fine except when going to start development instance using

yarn run watch:venia

Constantly getting this error:

  cat:
  /home/narendra/.config/devcert/certificate-authority/certificate.cert:
  No such file or directory Error:
  [pwa-buildpack:Utilities:configureHost.js] Could not setup development
  domain: Error: Command failed: sudo cat
  /home/narendra/.config/devcert/certificate-authority/certificate.cert
  cat:
  /home/narendra/.config/devcert/certificate-authority/certificate.cert:
  No such file or directory

Seems as if certificate file not generated, how can we resolve that.


texts: How to get customer session data outside Magento

texts:
I want to know if it is possible to get customer session data outside of magento2

<?php
error_reporting(E_ALL | E_STRICT);
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
$app = Mage::app('default');
Mage::app();
?>


texts:
Updating modules:
Connection "default" is not defined

When I run Upgrade command I am getting this error?


texts: Magento 2 - Layered navigation show products with salable quantity to 0

texts: In my store I have all products with only 1 quantity. When I buy a product, its "Salable Quantity" is 0 instead its "Quantity" stays 1 and thats ok, because the product is only "reserved" and the quantity decrease only after shipping. But in  Layered Navigation the product is show as available, but if I go in product detail page, the product is show as "Sold". Why in Layered Navigation the product is not show as "Sold"? Why in Layered Navigation Magento uses the Stock status and not the Salable Quantity to show if product is sold or not?


texts: Magento 2.3 - Paypal Credit Wont Go away from MiniCart

texts:
I 100% have Paypal Credit disabled in all sections of Configuration -> Payment methods.

The only section enabled is Paypal Express Checkout, and "advertise PayPal Credit" is definteluy not filled in. All the other Paypal sections that are not enabled also have "Enable Paypal Credit" set to "No"

Yet, I am still getting the checkout with PayPal credit on my minicart.

Only in Magento Version 2.3. Any ideas?


texts: Magento same order mail sending for admin and customer

texts: When a new order is placed, the same mail copy is sending to both admin and the customer. I tried with different mail templates in the admin panel


texts: Bulk change "Available Product Listing Sort By" for all categories?

texts:
I have a big Magento Store with about 200 categories. Currently, "Available Product Listing Sort By" for all categories is set to "Use All Available Attributes".

For about 10 categories, I would like to add some more custom attributes, which shouldn't appear in the other categories. Therefore I have to uncheck "Use All Available Attributes" for all categories and choose them manually.

Is there a way to change this for all categories in one step?


texts: custom product option drop down get image in magento 2.3

texts:
I am trying to add a product custom option drop down in product details page get image in magento 2.3
please check our snapshot product details page.


texts: Magento 2: remove menu links from customer account

texts: I want to remove these links Downloadable products, My wishlist, Stored payment method, Billing agreement form customer My Account page. Do you have any idea?


texts: Magento 2 how to use many components inside a component knockout js?

texts:
I wan't to import components and use them just like in Vue or ReactJs. Where you can
export default component

And import it by using
import Name from './path/to/component';

and finally use it
How can I do this same thing but on Magento 2? I know that on top I can use require or define, but when I import the component can't use it's template or functions just like in React the functional components.
For example:
define(['jquery', 'uiComponent', 'ko', 'Vendor_Module/js/component'], function ($, Component, ko, customComponent) {

  customComponent //here I expect to use it's template and also send props o get data from it
}

Greetings!


texts:
I'm looking for best practice in order to manage magento submodules, my plan was to use modman but I've heard about modgit.
Is there any benchmark modman vs modgit?
Advantages / disadvantages or each one, I don't know which one I should use. Any recommendations ?


texts: In which Magento table Paypal Sale ID is stored

texts:
We recently had a requirement to show the "Paypal sale id" in one of the reports and i have been searching the database table where it is showed and unable to find it.Can someone please let me know to which table that i need to look for it.

I have already searched sales_flat_order_payment  & sales_flat_order table and didn't find any thing.

Below is the attached image and i need the Paypal Sale ID ,I'm able to get Paypal Execution ID .ANy suggestions will be of great help.


texts:
I want to remove the below lines in Magento\Quote\Model\PaymentMethodManagement model file

 if (!$this->zeroTotalValidator->isApplicable($payment->getMethodInstance(), $quote)) {
            throw new InvalidTransitionException(__('The requested Payment Method is not available.'));
        }

In PaymentMethodManagement file:

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Quote\Model;

use Magento\Framework\Exception\State\InvalidTransitionException;

/**
 * Class PaymentMethodManagement
 */
class PaymentMethodManagement implements \Magento\Quote\Api\PaymentMethodManagementInterface
{
    /**
     * @var \Magento\Quote\Api\CartRepositoryInterface
     */
    protected $quoteRepository;

    /**
     * @var \Magento\Payment\Model\Checks\ZeroTotal
     */
    protected $zeroTotalValidator;

    /**
     * @var \Magento\Payment\Model\MethodList
     */
    protected $methodList;

    /**
     * Constructor
     *
     * @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
     * @param \Magento\Payment\Model\Checks\ZeroTotal $zeroTotalValidator
     * @param \Magento\Payment\Model\MethodList $methodList
     */
    public function __construct(
        \Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
        \Magento\Payment\Model\Checks\ZeroTotal $zeroTotalValidator,
        \Magento\Payment\Model\MethodList $methodList
    ) {
        $this->quoteRepository = $quoteRepository;
        $this->zeroTotalValidator = $zeroTotalValidator;
        $this->methodList = $methodList;
    }

    /**
     * {@inheritdoc}
     */
    public function set($cartId, \Magento\Quote\Api\Data\PaymentInterface $method)
    {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->get($cartId);

        $method->setChecks([
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_CHECKOUT,
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_COUNTRY,
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_CURRENCY,
            \Magento\Payment\Model\Method\AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX,
        ]);
        $payment = $quote->getPayment();

        $data = $method->getData();
        $payment->importData($data);

        if ($quote->isVirtual()) {
            $quote->getBillingAddress()->setPaymentMethod($payment->getMethod());
        } else {
            // check if shipping address is set
            if ($quote->getShippingAddress()->getCountryId() === null) {
                throw new InvalidTransitionException(__('Shipping address is not set'));
            }
            $quote->getShippingAddress()->setPaymentMethod($payment->getMethod());
        }
        if (!$quote->isVirtual() && $quote->getShippingAddress()) {
            $quote->getShippingAddress()->setCollectShippingRates(true);
        }

        if (!$this->zeroTotalValidator->isApplicable($payment->getMethodInstance(), $quote)) {
            throw new InvalidTransitionException(__('The requested Payment Method is not available.'));
        }

        $quote->setTotalsCollectedFlag(false)->collectTotals()->save();
        return $quote->getPayment()->getId();
    }}

How to do this.
Thanks.


texts:
I'm developing a magento store on a server which i don't have access to SSH right now. Can we possibly reindex without SSH?

http://screencast.com/t/v3pb8E8Ho!


texts: Add Custom module PHTML in My order View page?

texts:
I add phtml in frontend sales order view page.
frontend/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <type name="Magento\Sales\Block\Order\View">
        <plugin name="sales-order-view-seller" type="Companyname\Modulename\Plugin\Block\Order\View" />
  </type>
</config>

View.php

<?php

namespace Companyname\Modulename\Plugin\Block\Order;

class View extends \Magento\Framework\View\Element\Template {

    public function beforeToHtml(\Magento\Sales\Block\Order\View $originalBlock) {

        $originalBlock->setTemplate('Companyname_Modulename::seller_review_view.phtml');
    }
}

Code is working but phtml content showing two times.
Any Thing wrong ?


texts:
How can i set the salable quantity value as No manage Stock in magento 2.3.3
https://prnt.sc/xcehjd


texts: How to append a string "/xyz" to the magento2 URL

texts:
I'm setting a Magento docker developer environment and it has the base URL as "http://magento2.docker/". Now I have a request to append "/xyz" to url and make it "http://magento2.docker/xyz/".
I tried changing the base URL ( both secure and non-secure) in Magento admin panel. It adds the /shop to the url and return 404 Not found Page with css and js not loading.
Am I missing some thing? Please guide me. Thanks


texts: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

texts:
when i update my any product from magento admin back end below error come

SQL STATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db name.catalog_product_entity_int, CONSTRAINT CATALOG_PRODUCT_ENTITY_INT_ROW_ID_CATALOG_PRODUCT_ENTITY_ROW_ID FOREIGN KEY (row_id) REFERENCES catalog_product_entity (ro), query was: INSERT INTOcatalog_product_entity_int(entity_id,attribute_id,store_id,value) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATEvalue= VALUES(value`)


texts: Magento 2 :- How to add join query in single trail

texts:
working fine, I want to join  query in my custom module

/**
     * Lazy loads the requested post
     * @return Post
     * @throws LocalizedException
     */
    public function getPost()
    {
        if ($this->_post === null) {
            /** @var Post $post */
            $post = $this->_postFactory->create();
            $post->load($this->_getPostId());
            if (!$post->getId()) {
                throw new LocalizedException(__('Trails not found'));
            }
            $this->_post = $post;
        }
        return $this->_post;
    }

**
 Query

  $postCollection->getSelect()->join( array('customer_entity'=> $postCollection->getTable('customer_entity')), 'customer_entity.entity_id = main_table.entity_id');


texts: Address format checkout page issue in Magento 2.2.3

texts:
On the checkout page the address format is not assumed. Customer address format defined in the backend is ignored.

This is the format defined in backend

  {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}{{depend firstname}}{{/depend}}
      {{depend company}}{{var company}}{{/depend}}
      {{if street1}}{{var street1}}{{/if}}

  {{depend street2}}{{var street2}}{{/depend}}
      {{depend street3}}{{var street3}}{{/depend}}
      {{depend street4}}{{var street4}}{{/depend}}
      {{if postcode}}{{var postcode}}{{/if}} {{if city}}{{var city}},  {{/if}}{{if region}}{{var region}}{{/if}}
      {{var country}}
      {{depend vat_id}}UID-Nummer: {{var vat_id}}{{/depend}}

Magento2 V 2.2.3 - default checkout page


texts: My Observer invoke in windows but not in linux

texts:
Here is the xml:

<?xml version="1.0"?>

<config>
    <modules>
        <RayMan_Adminlog>
            <version>1.0.0</version>
            <title>Admin log module</title>
        </RayMan_Adminlog>
    </modules>
    <global>
        <models>
            <adminlog>
                <class>RayMan_Adminlog_Model</class>
                <resourceModel>adminlog_mysql4</resourceModel>
            </adminlog>
            <adminlog_mysql4>
                <class>RayMan_Adminlog_Model_Mysql4</class>
                <entities>
                    <adminlog>

admin_log

                    </adminlog>
                </entities>
            </adminlog_mysql4>
        </models>
        <helpers>
            <adminlog>
                <class>RayMan_Adminlog_Helper</class>
            </adminlog>
        </helpers>
        <blocks>
            <adminlog>
                <class>RayMan_Adminlog_Block</class>
            </adminlog>
        </blocks>
        <default>
            <adminlog>
                <general>
                    <enable>1</enable>
                </general>
            </adminlog>
        </default>

    </global>
    <admin>
        <routers>
            <adminlog>
                <use>admin</use>
                <args>
                    <module>RayMan_Adminlog</module>
                    <frontName>adminlog</frontName>
                </args>
            </adminlog>
        </routers>
    </admin>
    <adminhtml>
    <layout>
        <updates>
            <adminlog>
                <file>adminlog.xml</file>
            </adminlog>
        </updates>
    </layout>
    <events>
        <sales_order_invoice_pay>
            <observers>
                <rayman_adminlog_controller_action_predispatch_observer>
                    <class>Rayman_Adminlog_Model_Observer</class>
                    <method>sales_order_invoice_pay</method>
                </rayman_adminlog_controller_action_predispatch_observer>
            </observers>
        </sales_order_invoice_pay>
    </events>
    </adminhtml>
</config>

Observer class:

<?php
class Rayman_Adminlog_Model_Observer
{
    public function __construct()
    {
    }
    /**
     *
     *
     *
     */
    public function sales_order_invoice_pay($observer)
    {

      $event = $observer->getEvent();
      $eventName = $event->getName();
      $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
      $connection->beginTransaction();

      $__fields = array();
      $__fields['action'] = $eventName;
      $userData = $this->getAdmin();
      $username = $userData['user']->username;
      $__fields['admin_name'] = $username;
      $connection->insert('admin_log', $__fields);
      $connection->commit();

      //return $this;
    }

    private function getCurrentAdminName() {

    }

    private function getAdmin() {
        $user = Mage::getSingleton('admin/session')->getData();
        return $user;

    }
}


texts: Add to cart - Does Magento escape data by default?

texts:
I intend to allow user customize their product before add to cart by a custom route (eg: example.com/customize/id/123).

I use POST method. Data will be added to order attributes.

I wonder if Magento escape data behind the scenes or I have to do that myself?

Thanks.


texts:
I realized that it is possible to register customers through API without authentication.

https://devdocs.magento.com/guides/v2.2/rest/anonymous-api-security.html

Just make a POST call to https://example.com/rest/V1/customers
with JSON content:

{
    "customer":{
        "email": "customer@email.com",
        "firstname": "Customer Name",
        "lastname": "Customer Lastname"
    },
    "password": "UserPassword"
}

What would happen if an attacker exploited this possibility to "dirty" my customer database?

How can we protect?

Thanks


texts: How to override or extend Product List Page template to show Icon on Product Images in Magento Extension

texts:
Consider the Below Image

I want to show an Icon on the Image of each product. I am developing an extension and I want to do this task via that extension, independent of theme. How can I achieve this task. what Blocks I've to extend. Any kind of suggestion and help will be appreciable.
Thanks in advance.

Updated:

After adding the suggested code I'm getting the below error


texts: Adding more than one column in Sales Grid

texts:
Edit: I managed to add the city column by changing parent to entity, and the city initially appeared in the Grid, but once we started working in the admin, we would eventually get an error!

I used: protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->join('sales_flat_order_payment', 'main_table.entity_id = sales_flat_order_payment.parent_id',array('po_number'));
        $collection->getSelect()->join('sales_flat_order_address', 'main_table.entity_id = sales_flat_order_address.entity_id', array('city'));
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

I successfully added one column into the sales gird by using:

 protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $collection->getSelect()->join('sales_flat_order_payment', 'main_table.entity_id = sales_flat_order_payment.parent_id',array('po_number'));
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

But when I try to add one more by using the following, I get an error. What am I doing wrong?:

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $collection->getSelect()->join('sales_flat_order_payment', 'main_table.entity_id = sales_flat_order_payment.parent_id',array('po_number'));
    $collection->getSelect()->join('sales_flat_order_address', 'main_table.entity_id = sales_flat_order_address.parent_id',array('city'));
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

I have the corresponding columns in prepareColumns of course:

$this->addColumn('po_number', array(
        'header' => Mage::helper('sales')->__('PO#'),
        'index' => 'po_number',
    ));

    $this->addColumn('city', array(
        'header' => Mage::helper('sales')->__('City'),
        'index' => 'city',
    ));

Thanks so much in advance for any help!


texts: How to check Customer login or not when we click on customer navigation tab magento2?

texts:
In Magento 1 if we create custom customer navigation link in that when we load page that time we check that customer is login or not if not than we redirect that page to login page using this code in controller

public function preDispatch()
{
    parent::preDispatch();

    if (!Mage::getSingleton('customer/session')->authenticate($this)) {
        $this->setFlag('', 'no-dispatch', true);
    }
}

In Magento 2 How can i check this if customer is not login than redirect to login page???


texts: CONNECT ERROR: Failed to create directory

texts:
The mentioned error comes when I try to upload an extension package to my local machine via System -> Magento Connect -> Magento Connect Manager > Direct package file upload.

I have given 777 access to all the directories of magento installation but it still keep on showing same error.


texts: Different admin URL for each website - Magento 2.1.1

texts:
I trying to configure M2 (2.1.1) multiwebsite.

I already created separate websites/stores/views for each website, I also configured vhosts, M2 admin config and .htaccess. All websites are works fine except one thing.. admin login URL. How to set up this URLs like this:

example.com/admin - root M2 website admin login works fine

example2.com/admin - other M2 website admin login

Now, if i trying to access example2.com i get  errors : http://pastebin.com/VbCqGzSV

Here you have my other setting:

.htaccess config:

###########################################
## settings fot webiste example2.com
## WEBSITE CODE: example2com
SetEnvIf Host .*example2.com.* MAGE_RUN_CODE=example2com
SetEnvIf Host .*example2.com.* MAGE_RUN_TYPE=website
###########################################

## example2.com
RewriteCond %{HTTP_HOST} ^(.*)example2\.com
RewriteRule .* – [E=MAGE_RUN_CODE:example2com]
RewriteCond %{HTTP_HOST} ^(.*)example2\.com
RewriteRule .* – [E=MAGE_RUN_TYPE:website]
## END OF: example2.com

Also vHost config file:

<VirtualHost *:80>
    DocumentRoot        /var/www/html/example2
    ServerName example2.com
    SetEnv MAGE_RUN_CODE "example2com"
    SetEnv MAGE_RUN_TYPE "website"
</VirtualHost>

Configuration of Example2.com Website:


texts:
Follwoing are the Paypal methods available in New Magento 1.7

PayPal All-in-One Payment Solutions  Accept and process credit cards and PayPal payments.

Paypal Payments Advanced (Includes Express Checkout)

Basic Settings - PayPal Payments Advanced
Basic Settings - PayPal Express Checkout

Paypal Payments Pro (Includes Express Checkout)

Basic Settings - PayPal Payments Pro
Basic Settings - PayPal Express Checkout

Paypal Payments Standard

Basic Settings - PayPal Payments Standard

PayPal Payment Gateways
*Payflow Pro (Includes Express Checkout)*
 - Basic Settings - PayPal Payflow Pro
 - Basic Settings - PayPal Express Checkout

Payflow Link (Includes Express Checkout)

Basic Settings - PayPal Payflow Link
Basic Settings - PayPal Express Checkout

PayPal Express Checkout
 - Express Checkout

Now my question is which one of the above paypal method is useful , if i need to setup my paypal like , customer can enter the CC details on the Checkout and they will not be redirected to paypal .

Thanks


texts: In Magento 2 is there any chance to broke site due to spaces in di.xml file

texts: Is there any chance or any cause to broke the site due to spaces in di.xml file in Magento 2


texts: Attribute type date displaying wrong format

texts:
I create a date attribute with date type as date. In the admin the date format is MM/DD/YYYY but when the date appears on the front-end of the product page the date format is DD/MM/YYYY

Any insight on how to get the front-end to match the admin would be great. Thank you for the help.


texts: Magento 2.3 Error on Delete All Test Data from Database

texts:
We are in the process of migrating to Magento 2.3, but need to remove all test data from the database and reset all increment ID's back to 1.  Having some troubles removing all order information:
SET FOREIGN_KEY_CHECKS = 0;

TRUNCATE TABLE `gift_message`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;
TRUNCATE TABLE `reporting_orders`;
TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;
TRUNCATE TABLE `sales_creditmemo`;
TRUNCATE TABLE `sales_creditmemo_comment`;
TRUNCATE TABLE `sales_creditmemo_grid`;
TRUNCATE TABLE `sales_creditmemo_item`;
TRUNCATE TABLE `sales_invoice`;
TRUNCATE TABLE `sales_invoiced_aggregated`;
TRUNCATE TABLE `sales_invoiced_aggregated_order`;
TRUNCATE TABLE `sales_invoice_comment`;
TRUNCATE TABLE `sales_invoice_grid`;
TRUNCATE TABLE `sales_invoice_item`;
TRUNCATE TABLE `sales_order`;
TRUNCATE TABLE `sales_order_address`;
TRUNCATE TABLE `sales_order_aggregated_created`;
TRUNCATE TABLE `sales_order_aggregated_updated`;
TRUNCATE TABLE `sales_order_grid`;
TRUNCATE TABLE `sales_order_item`;
TRUNCATE TABLE `sales_order_payment`;
TRUNCATE TABLE `sales_order_status_history`;
TRUNCATE TABLE `sales_order_tax`;
TRUNCATE TABLE `sales_order_tax_item`;
TRUNCATE TABLE `sales_payment_transaction`;
TRUNCATE TABLE `sales_refunded_aggregated`;
TRUNCATE TABLE `sales_refunded_aggregated_order`;
TRUNCATE TABLE `sales_shipment`;
TRUNCATE TABLE `sales_shipment_comment`;
TRUNCATE TABLE `sales_shipment_grid`;
TRUNCATE TABLE `sales_shipment_item`;
TRUNCATE TABLE `sales_shipment_track`;
TRUNCATE TABLE `sales_shipping_aggregated`;
TRUNCATE TABLE `sales_shipping_aggregated_order`;
TRUNCATE TABLE `tax_order_aggregated_created`;
TRUNCATE TABLE `tax_order_aggregated_updated`;

ALTER TABLE `sales_order` AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS = 1;

Produces the following SQL Error:

TRUNCATE TABLE quote
Cannot truncate a table referenced in a foreign key constraint (m2.quote_address, CONSTRAINT QUOTE_ADDRESS_QUOTE_ID_QUOTE_ENTITY_ID FOREIGN KEY (quote_id) REFERENCES m2.quote (entity_id))


texts: How To Display Single Image Thumbnail in product detail page Magento 2

texts: I want to know how can I display thumbnail image, if the product has only one image . (product detail page)


texts: Getting future date in calendar instead of today's date in Magento 1 issue

texts:
This is my setup for the calendar:

Calendar.setup({
  inputField : 'scheduled_ajax_update',
  ifFormat : '%Y-%m-%d',
  button : 'scheduled_ajax_update_trig',
  align : 'Bl',
  singleClick : true
});

Its working fine except that I got a future date. See img attached:

Any idea why I got this ?

Thx :)