texts: Magento - Production and Test environment - Best practices

texts:
I know there are some posts related to this topic available, but I do think it covers my questions:

I have now set up two environment: Staging and Production, as the shop is not live yet it is quite easy to maintain, as the both sites are identical.
However when orders, customers etc starts to flow in the production environment and we start creating test orders in the test environment, that is when it becomes messy.

Scenario 1: Take db backup daily and take backup of files if changes are done. This can be done through ssh on the server. Not ideal, but it works I guess.

Scenario 2: Lets say I want to install a new module, that will impact both the db and the files. Then I create it in the test environment, see that it works, and then I install it directly in the production environment. "Crossing my fingers that it will work".

So currently what I have done is that I have connected my test and prod env to mageflow, so when I add products, changes to cms etc, I can push it to the prod env. In this way I can work in test and push changes when im ready. This works fine.

However my biggest question is how should I handle magento upgrades, installing of custom modules etc. I tried creating a bitbucket account, but I was not able to put the magento files into the .git. After spending some time on that it struck me that I didnt have a versioning on the database.

Can somebody explain to me step by step how I should set up my shop, so that I can get it correctly from day 1. So that it is easy to test out new modules, upgrade magento etc without having to much downtime on the prod environment.

Looking forward to hear your reply on this topic.

Thanks


texts: Make different registration form for multi website magento store

texts:
I have multi website magento store and on one website I have to show the default registration form but on the other website I want to show different registration form on other website with many custom fields like the one shown in image below.

followed steps like in the answer but had no luck.
Different registration forms on different websites


texts: Working with Database for Magento Certification

texts:
I am preparing for magento certification exam. As per MCD guide:

Working with Database  13%
Entity Attribute Value Model  13%

both these topic covered more than 25% of exam. but I am little confused about its scope means in how much deep I will study for these topics.

Regarding Database: Magento have around 350 tables, do i need to study about these table relationship, purpose etc.


texts: Is it Best Practice to start with a SEO module?

texts:
Our previous experience is with a 100% in-house built commence platform where we were in full control of every aspect of our site, including SEO. After a few months, we're beginning to wrap up stage 1 development on our new Magento (EE 1.13) site and preparing to go live.

The critical modules IMO have been the specialized functionality that have helped create our store and allowed us to do the things we need to do. The question I'm carefully trying to ask is: how critical are SEO modules? and is this a no brainer decision for a serious megento shop? Or have recent versions of magento improved SEO presence enough to make proper shop setup the more important issue?

I don't expect a SEO module to be a silver bullet solution but in general, is it a module an experienced magento expert wouldn't consider going live without?


texts: Image Upload goes 100% and then I get an error in red and asks me to Remove file

texts:
I am having the exact same problem as stated here:
"products image upload error after upload 100%"

I am trying to upload images to an already existing Magento website, my images go 100% and then I get an error in red asking to remove the images. I have followed most of the tutorial I could find online, all my media/ and var/ folder have 777 permission, I have php5-gd installed on my server, the baseurl and secureurl is set properly.

Last time I have had this problem I had a hired a freelancer to resolve it, he told me, varnish setting had issues but didn't give me details.

Any help appreciated.


texts: Custom payment method: Info Block cannot get data from From Block

texts:
Today I am trying to create a custom payment method. Which requires user to fill in 2 fields and they all shows in the One-page Checkout Process. However, when I finished them and continue to the next step. The Info Block on the right side showed only the method title.

Please help.. Thank you a lot!

Below are my files:

Model:

<?php
class Tai_Smartpay_Model_Smartpay extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'tai_smartpay';
protected $_formBlockType = 'tai_smartpay/form_smartpay';
protected $_infoBlockType = 'tai_smartpay/info_smartpay';

public function assignData($data)
{
    $info = $this->getInfoInstance();

    if ($data->getCustomFieldOne())
    {
        $info->setCustomFieldOne($data->getCustomFieldOne());
    }

    if ($data->getCustomFieldTwo())
    {
        $info->setCustomFieldTwo($data->getCustomFieldTwo());
    }

    return $this;
}
public function getOrderPlaceRedirectUrl()
{
    return Mage::getUrl('tai_smartpay/payment/redirect', array('_secure' => false));
}

Block Form:

<?php
class Tai_Smartpay_Block_Form_Smartpay extends Mage_Payment_Block_Form
{
protected function _construct()
{
    parent::_construct();
    $this->setTemplate('tai_smartpay/form/smartpay.phtml');
}
}

Info Block:

?php
class Tai_Smartpay_Block_Info_Smartpay extends Mage_Payment_Block_Info
{
protected function _prepareSpecificInformation($transport = null)
{
    if (null !== $this->_paymentSpecificInformation)
    {
        return $this->_paymentSpecificInformation;
    }

    $data = array();
    if ($this->getInfo()->getCustomFieldOne())
    {
        $data[Mage::helper('payment')->__('Custom Field One')] = $this->getInfo()->getCustomFieldOne();
    }

    if ($this->getInfo()->getCustomFieldTwo())
    {
        $data[Mage::helper('payment')->__('Custom Field Two')] = $this->getInfo()->getCustomFieldTwo();
    }

    $transport = parent::_prepareSpecificInformation($transport);

    Zend_Debug::dump($this->getInfo()->getCustomFieldOne());

    return $transport->setData(array_merge($data, $transport->getData()));
}
}

and Template:

<div class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">

    <?php echo $this->__('Custom Field One') ?>*

  <input type="text" title="<?php echo $this->__('Custom Field One') ?>" name="payment[custom_field_one]" value="<?php echo $this->htmlEscape($this->getInfoData('custom_field_one')) ?>" />

    <?php echo $this->__('Custom Field Two') ?>*

  <input type="text" title="<?php echo $this->__('Custom Field Two') ?>" name="payment[custom_field_two]" value="<?php echo $this->htmlEscape($this->getInfoData('custom_field_two')) ?>" />

<?php echo $this->getMethod()->getConfigData('message');?>


texts: Order status "Payment Review" with "processing" or "payment_review" state?

texts:
Native Magento EE comes with an order status Payment Review with payment_review and payment_review for the status code and state code, respectively. Let's call this status A.

I came across an already-installed extension that installed a separate Payment Review order status but with processing state code. Call this status B. In the order flow, an order goes into Payment Review if it fails an initial fraud check or if the invoice somehow fails to capture after it's been authorized.

Is there a reason to be using status B over A, or vice versa, for any particular reason? I would stick with the native status, A and B seem redundant.


texts: I want to hide shipping or don't want to show shipping method in one page checkout page please tell me how to do it ?


texts:
does anyone know if there is a simple way or extension to disable price indexer per customer group?

i have over 1000 Customer groups and over 100k products in catalog. So the price indexer raises extremly in numbers.

I don't need the feature to have different prices for each customer group.

Anyone has a solution for this?

Thx


texts: cron:remove and cron:install command is not working. Magento 2

texts:
I'm trying to remove cron but it is not working and as well on install as well it is not working but in case of cron:run it works while I run the above two commands it give me an error C:\xamppp\htdocs\magento>php bin/magento cron:remove
Your operating system is not supported to work with this command


texts: How to add custom field to upload image in registration.phtml file

texts: How to add custom option(field) where when customer create his/her account he/she can upload his her image and also in edit file he/she can resize or manipulate this image


texts: How to check PLP page layered navigation attributes selected or not using Observer?

texts:
I am using event ( catalog_product_collection_load_before )for check PLP page layered navigation attributes selected or not, my observer,
app\code\Zero\DescBlock\Observer\Data.php
<?php

namespace Zero\DescBlock\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Catalog\Model\Layer\Resolver as LayerResolver;
use Psr\Log\LoggerInterface;

class Data implements ObserverInterface
{
    /**
     * @var \Magento\Catalog\Model\Layer\Category
     */
    protected $catalogLayer;

    /**
     * @var \Psr\Log\LoggerInterface
     */
    private $logger;

    /**
     * @param LayerResolver $layerResolver,
     */
    public function __construct(
        LayerResolver $layerResolver,
        LoggerInterface $logger
    ) {
        $this->catalogLayer = $layerResolver->get();
        $this->logger = $logger;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {

        // Get selected filters
        $layer         = $this->catalogLayer;
        $activeFilters = $layer->getState()->getFilters();

        // checking variable activeFilters using log
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/custom.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('Your log details: ' .$activeFilters);

    }
}

Log not return anything.
Any help thanks?


texts:
I need to have 2 newsletter blocks on same page.
Second newsletter template is different from first one. So, how can i call same newsletter php logic and output it in 2 different pthml files (that will have different html structure inside).
I hope i was clear about what i'm trying to do.

Thank you!


texts: php bin/magento setup:upgrade is not working

texts:
I'm trying to run upgrade command but I'm getting this error. Any help would be appreciated (see picture).

P.S: User = Root, and privileges are ALL YES in 'magento2' DB.
M2.2.3 and PHP 7.


texts: Admin dashboard Most Viewed Products Tab statistics not updating

texts: Most Viewed Products tab records not being updating while visit to many products with guest user or even registered user.


texts: How to get custom attribute value in multi store config

texts:
in one shop config I use to get attr value

$_product = Mage::getModel('catalog/product')->load($_product->getId());
$att_value = Mage::getModel('catalog/product')->load($_product->getId())->getMyattribute();

but on multi store config its not work. How I can fix it?


texts: TypeError: $(...).foundation is not a function - Magento 1.9

texts:
I want to itegrate Foundation 6 in Magento but i get this error on app.js file on $(document).foundation()

I just try with jQuery(document).foundation() but does not works


texts: How to get getPaymentHtml($order) or var payment_html in a custom email

texts:
I have a cron sending emails and I need it to have the variables that an regular order email have so I can usem them, in this case the payment_html var but I can't get it here in the Vendor_name/Module_name/Helper/Email.php
I tried with
public function __construct(
        Context $context,
        ...
        \Magento\Framework\View\Element\BlockFactory $blockFactory
    ) {
        ...
        $this->_blockFactory = $blockFactory;
    }

and call it as
$blockFactory->getPaymentHtml($order)

it does not give me and error but don't send the email, if I remove that line from the vars it works fine.
How should I get that block?
Thanks :D


texts: Suggestion for a custom drop ship scenario

texts:
I'm working with a client to build a store with a somewhat unique dropship style set up:

We will keep some stock at a warehouse which is our buffer stock level.
When a shopper purchases item(s), an order email is to be sent both to the store owner and the warehouse.
Warehouse will dispatch the items.
A daily digest email of all the items sold will then need to be sent to the manufacturer of the goods. They will dispatch the items to the ware house to replenish the buffer stock. But we want the order email tot he manufacturer to be stripped of any shopper's information.

Before we start considering an original solution, are there any extensions on the market that be configured to do this, (or with some modification).

Or would this need to be a ground up job?

Thanks


texts: Magento1 | Collection how get all products where qty > 1, build query

texts:
I have this code

       $productCollection = Mage::getModel('catalog/product')
        ->getCollection()
        ->addAttributeToFilter('attribute_set_id',array(12,4))
        ->setPageSize(35000)
        ->load();

How to build a query like this, get all products WHERE QTY > 1
How i can do this?


texts: How can I show all the [add to cart] buttons on the same line?


texts: Pay with Amazon - Shipping/Billing Addresses Blank

texts: I'm trying to get Pay with Amazon set up, and everything seems to work fine except that, during checkout, Magento doesn't seem to display the billing address or shipping address. I've run through the process in Sandbox mode and the transaction goes through without an issue, but for whatever reason it just isn't displaying the address information on the checkout screen. Has anyone else experienced this and know how to solve it?


texts:
I'm developing my own theme and I added some styling in _theme.less which I have put in app/design/frontend/MyVendor/mytheme/Magento_Theme/web/css/source/_theme.less. No style changes are updated when doing styling in _theme.less. I've tried deleting the static files and cleaning the cache as well.

I can make CSS changes when adding my own .css file in default_head_blocks.xml but not when trying to use _theme.less. Not sure what the problem is.


texts: Observer not triggered for customer_register_success event

texts:
I've read through countless posts with similar issues and have made sure I didn't have the same errors.

I'm trying to use the customer_register_success event to trigger an observer that will fetch an image from Gravatar and save it on my server. The code for saving it to my server works fine, as I've tested it. The issue is the fact that the observer isn't being called when a customer registers.

config.xml

<config>
<modules>
    <Namespace_Getavatar>
        <version>1.0.0</version>
    </Namespace_Getavatar>
</modules>

<global>
  <models>
        <getavatar>
            <class>Namespace_Getavatar_Model</class>
        </getavatar>
    </models>
    <events>
        <customer_register_success>
            <observers>
                <Namespace_Getavatar_Model_Observer>
                    <type>singleton</type>
                    <class>Namespace_Getavatar_Model_Observer</class>
                    <method>setAvatar</method>
                </Namespace_Getavatar_Model_Observer>
            </observers>
        </customer_register_success>
    </events>
</global>

Observer.php

class Namespace_Getavatar_Model_Observer {

public function setAvatar(Varien_Event_Observer $observer)
{
    //fetching and saving avatar image

}

}

Namespace_Getavatar.xml

<config>
  <modules>
    <Namespace_Getavatar>
        <active>true</active>
        <codePool>local</codePool>
    </Namespace_Getavatar>
  </modules>
</config>

I'm using a username plugin, but I don't think that could interfere with the event itself?


texts: Options for upgrading from Magento CE 1.6 to CE 1.9 and bringing customer records across

texts:
I have a 2.5 year old Magento CE 1.6 site that I would like to upgrade to CE 1.9.

Due to changes within a number of areas - theme, extensions I am using, attribute sets etc. - I am in the process of starting from scratch on the Magento CE 1.9 site.

The only issue I have is that I want the customer records to come across to the new site without resetting their passwords.

From what I can see the encryption method of the customer passwords has changed from 1.6 to 1.9, so even with the same encryption key, I am not sure if this would work.

Is this, in any way, possible?


texts: Magento2: How to change size photo for Virtual Product?

texts:
Example all products type on website on front end have image size 800x800
Is any way to change image size for Virtual Product example to 800x400 ?


texts:
Put Popup On Add to Cart Button and If Add to Cart Button Clicked than First Check Customer is Loggedin or Not? And If not Loggedin Than Login Form should be open in Popup.
Can Any One Help me? Any Kind of Help will Appreciate.


texts: How to do the same controller action to create an image for one button but not for another?

texts:
We are calling same controller action for 2 buttons for create product pro-grammatically and assign a custom image for that product.

1. create - custom image  uploading for newly created product

2. login - custom image not uploading for newly created product

Create:

<button  onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();" id="submit-editorApply-{{rand}}" title="{{apply_text}}">{{apply_text}}</button>

initObservers: function() {
    if (this.config.editorEnabled) {
        $('submit-editorApply-' + this.config.rand).observe('click', this.saveDesignBut.bindAsEventListener(this));
    }
},

Login code:

$params = array(
    '_secure' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on'),
    'id' => Mage::registry('current_product')->getId()
);

<form id="ajaxlogin-login-form" action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect', $params) ?>">

<button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><?php echo $this->__('Login') ?></button>

Controller code:

$images = array(
    'thumbnail' => 'image.png', // displaying under cart
    //'small_image' => 'image.png',
    'image' => 'image.png' // displaying under my design
);

foreach ($images as $imageType => $imageFileName) {
    if ($newImagePath != "") {
        $dir  = Mage::getBaseDir('media') . DS . 'custom_product_preview/quote/';
        $path = $dir . $newImagePath;
    } else {
        $dir  = Mage::getBaseDir('media') . DS . 'example/amasty/';
        $path = $dir . $imageFileName;
    }
}

Please give me some hint for this ...


texts: Magento2- Dynamic row system config store data in database but after save not display in backed

texts:
My config file after save config data

After save data It also show error in console as there is no any field

after save data it does not give me unserialaize data my php file to render data in table is

<?php
        namespace Vendor\Module\Block\Adminhtml;

        use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;
        use Magento\Framework\DataObject;
        use Magento\Framework\Exception\LocalizedException;
        use Vendor\Module\Block\Adminhtml\PaymentMethod;
        use Vendor\Module\Block\Adminhtml\UnitMethod;

        class Payment extends AbstractFieldArray
        {

            private $pymentRenderer;

            private $unitRenderer;

            protected function _prepareToRender()
            {
                $this->addColumn('paymentmethod', [
                    'label' => __('Payment Method'),
                    'renderer' => $this->getPaymentRenderer()
                ]);
                $this->addColumn('duration', ['label' => __('Duration'), 'class' => 'required-entry']);
                $this->addColumn('unit', [
                    'label' => __('Units'),
                    'renderer' => $this->getUnitRenderer()
                ]);
                $this->_addAfter = false;
                $this->_addButtonLabel = __('Add');
            }

            protected function _prepareArrayRow(DataObject $row): void
            {
                $options = [];

                $pm = $row->getPaymentMethod();
                $unit = $row->getUnitMethod();
                if ($pm !== null) {
                    $options['paymentmethod_' . $this->getPaymentRenderer()->calcOptionHash($pm)] = 'selected="selected"';
                    \Magento\Framework\App\ObjectManager::getInstance()->get('Psr\Log\LoggerInterface')->info(print_r($options,true));
                    $row->setData('paymentmethod', $options);
                }
                $options = [];
                if ($unit !== null) {
                    $options['unit_' . $this->getUnitRenderer()->calcOptionHash($unit)] = 'selected="selected"';
                    \Magento\Framework\App\ObjectManager::getInstance()->get('Psr\Log\LoggerInterface')->info(print_r($options,true));
                    $row->setData('unit', $options);
                }

            }

            private function getPaymentRenderer()
            {
                if (!$this->pymentRenderer) {
                    $this->pymentRenderer = $this->getLayout()->createBlock(
                        paymentmethod::class,
                        '',
                        ['data' => ['is_render_to_js_template' => true]]
                    );
                }
                return $this->pymentRenderer;
            }
            private function getUnitRenderer()
            {
                if (!$this->unitRenderer) {
                    $this->unitRenderer = $this->getLayout()->createBlock(
                        unitmethod::class,
                        '',
                        ['data' => ['is_render_to_js_template' => true]]
                    );
                }
                return $this->unitRenderer;
            }
        }


texts: Create an additional field with "Rechnung an" via "Verschicken an" in Magento 2 Checkout

texts: If a different delivery address is indicated, i want create an additional field with "Rechnung an" via "Verschicken an" and display the entered address here. Please help me!


texts: Class adminhtml/catalog_product_helper_form_msrp_enabled does not exist error when mass updating product attributess

texts:
I am running Magento 2.2.2 and whenever I try to mass update product attributes, it gives me a whitescreen right after trying trying to get to the mass update screen from the product grid.

I checked the logs and the error is: main.CRITICAL: Class adminhtml/catalog_product_helper_form_msrp_enabled does not exist [] []

Module Magento_Msrp is enabled. I searched for a Enabled.php class, but could only find classes with that name in other modules (CMS, Analytics and Multishipping) ... maybe thats the problem, but why?

Any idea how to fix that or where to start looking?

Thanks!


texts: Updating to SUPEE-7405 Magento 1.9.1 ERRORS

texts:
Tried to update to SUPEE-7405 Magento patch with 1.9.1.0 using the .zip package as I'm on shared hosting with no SSH access.

Uploaded all the files successfully with FTP and came across 2 erros (maybe more??)

First on the Admin Backend;

  Fatal error: Class 'Mage_Core_Helper_UnserializeArray' not found in /home/pctekcom/public_html/app/Mage.php on line 547

Second on the Frontend Home Page;

Fatal error: Call to a member function isTypeAllowed() on boolean in /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 177

I've tried two different instances and the same errors occur I'm using PHP 5.6.18 as shown @

  pc-tek.com.au/test.php

Anyone got a working Magento 1.9.1.0 with SUPEE-7405?

Thanks,
Steve


texts: how to make manual indexing in ecomdev_phpunit catalogsearch tests with bulk products?

texts:
I am trying to test custom layered navigation filter (catalogsearch controller) functions and creating bulk products like this in my test:

    for ($i = 0; $i < $productNumber; $i++) {
            // random data generation
            $productInstance->setData($conditionsData);
            $productInstance->setName($randomTitle)
                ->setTypeId('virtual')
                ->setDescription($randomDesc)
                ->setSku($randomDesc)
                ->setAttributeSetId(4)
                ->setStatus(96)
                ->setVisibity(4)
                ->setPrice(rand(777,999))
                ->save();

            Mage::getModel('catalog/product_website')->addProducts(array(1), array($productInstance->getId()));
            Mage::getSingleton('catalogsearch/fulltext')->rebuildIndex(1, $productInstance->getId());
        }

I noticted when dispatching a catalogsearch/result/index request it is making query to catalog_category_product_index and catalog_product_index_price but this is a test case and these tables are empty, so i am trying to build index like following:

      $indexCodes = array('catalog_product_attribute',
        'catalog_product_price',
        'catalog_url',
        'catalog_product_flat',
        'catalog_category_flat',
        'catalog_category_product',
        'cataloginventory_stock',
        'filter_attribute',
        'tag_summary');

    foreach ($indexCodes as $indexCodeSingle) {
                $index = Mage::getSingleton('index/indexer')->getProcessByCode($indexCodeSingle);
                $index->reindexEverything();
            }

But after running indexing code my catalog_category_product_index and catalog_product_index_price are empty, why ?
Maybe I forgot to add some attributes to to products while creating them ?


texts:
Magento2 product detail page the image resize isn't working.

 ASPECTED RATIO NOT WORKED (100*100) resize function

I want to resize the image with a fixed width but it fails.


texts: Where is the code responsible for Luma's theme header resizing?

texts: I have extended Luma's theme and now making changes to it. I have set min-width for my design (for certain reasons). Thing is, when you're resizing browser, header becomes all messed up cause probably some javascript code is run that resizes things (and hides account links etc.). Where can I find the code that would stop header resizing? Thank you a lot!


texts: Magento 1: how to make an extension EE compatible?

texts:
So here's the thing I never had the chance to get my hands on a Magento EE.

That said I still would like to make my extensions EE compatible.

Let's say we're dealing here with a normal CRUD module.

I'm looking for a canonical answer on how could I achieve that specially regarding FPC and indexing. (And more maybe ?)


texts:
I am trying to add a custom validation rule with a mixin to use at the checkout.
I am following this tutorial.

So I have:

Mageplaza/HelloWorld/view/frontend/requirejs-config.js

var config = {
    config: {
        mixins: {
            'Magento_Ui/js/lib/validation/validator': {
                'Mageplaza_HelloWorld/js/validator-mixin': true
            }
        }
    }
};

Mageplaza/HelloWorld/view/frontend/js/validator-mixin.js

define([
    'jquery',
    'moment'
], function ($, moment) {
    'use strict';

    return function (validator) {

        validator.addRule(
            'validate-minimum-age',
            function (value, params, additionalParams) {
                return $.mage.isEmptyNoTrim(value) || moment(value, additionalParams.dateFormat).isBefore(moment().subtract(params.minimum_age, 'y'));
            },
            $.mage.__("Sorry, you don't have the age to purchase the current articles.")
        );

        return validator;
    };
});

I never call this validation just yet, but when I go to the checkout, I get this message:

Uncaught Error: Script error for: Mageplaza_HelloWorld/js/validator-mixin


texts:
I have two issues to solve .

In mystore->configuration->sales->order email copy when i add
something@gmail.com email is received (but in spam ).  but when i
add something@owndomain.co.uk . email is not received not even in
spam.
can we solve this spam issue ?   I am using Magento 2.2.6 , i
already did reply to path on but something is wrong maybe it is not
working .


texts:
I need to integrate our "Leopard Courier" (Local Courier) with magento 1.9.2.3. Our Leopard Courier also give us "APi Documents" but i don't under stand. We also have "API  KEY and Password" receive from leopard courier.
I don't know how can i integrate with magento. Our case is this from magento backend there must be a link "Generate the tracking Code or Generate Label" than its automatically connect to the leopard courier and take the tracking number from them and generate the print of 3 copies

Customer Copy
Account Copy
Label.

Mention on the print are :

Tracking Code
Magento Order Number
Customer Name
Address
Desination
Mob Number
Weight
Cash Collection Amount
Date
Shipper AC /Name
Shipper Address.


texts:
I use bellow code, which works fine, I'm able to show randomly 5 products from same category on my view page.

I would like to show only products which are in stock. Now it is showing both out of stock and in stock products.

<?php $categories = $_product->getCategoryIds();?>
        <?php $result = array();
        foreach($categories as $cat_id) {
        $category = Mage::getModel('catalog/category');
        $category->load($cat_id);
        $collection = $category->getProductCollection();
        foreach ($collection as $product) {
        $result[] = $product->getId();
        }
        }
        ?>

    <?php if(sizeof($result) >= 5)
    {
    $ourneed = array_rand($result,5);
    foreach($ourneed as $cc)
    {
    $thisproduct= Mage::getModel('catalog/product')->load($result[$cc]);
    ?>


texts: Magento 2: why 2.0 sample data are not compatible with 2.1?

texts:
Magento 2.1 Release Candidate 2 was released yesterday: http://devdocs.magento.com/guides/v2.0/release-notes/ReleaseNotes2.1_RC2CE.html

And according to the release notes:

  You cannot update from Magento 2.0.x to Magento 2.1.x with Sample
  Data.

I'm wondering what's the reason behing that ?

It caught my eyes because I assume sample data are the same as any merchant data and thus, means you can't update from Magento 2.0.x to Magento 2.1.x


texts: Read only field in UI component form Magento 2

texts:
I have to add read only form field in UI component form. I have tried disabled input field but it is different from the readonly as described below.
According to magento documentation:

Read-only Form Data:
It may be necessary or advantageous to display form field data that cannot
be changed or edited. In these cases the form label should appear to
provide context for the “read-only” data, but not the field
bounding-box so that it is clear to the user that the data cannot be
edited.

Link: http://devdocs.magento.com/guides/v2.0/pattern-library/getting-user-input/form_elements/form_elements.html#read

I have done a lot of research but can't figure it out by myself.
I will very grateful if someone can assist.


texts: Magento system.log 'Warning: SimpleXMLElement' - (adminNotification/Model/Feed.php) resulting in error 404 on backend

texts:
Hey guys I got following error:

  Warning: SimpleXMLElement::__construct(): in
  app/code/core/Mage/AdminNotification/Model/Feed.php
  on line 173

which prevents me from literally everything on the backend because everytime I want to edit a product or an order I get an error 404 message (Still can access the backend).

Now I already tried to google it Magento system.log 'Warning: SimpleXMLElement' - (adminNotification/Model/Feed.php) and people suggest that I had to turn off modules containing Mage_AdminNotification_Model_Feed or "AdminNotification". I literally deleted all the files of the modules which contains these words and deleted the modules from my module folder and I still get this error....

I also loaded a Backup where everything was fine and I STILL get this error... What can I do to fix this or maybe I'm doing it wrong?

The only path/modules I didn't deleted are these:

  includes\src\Mage_AdminNotification_Model_Feed.php,
  includes\src\Mage_AdminNotification_Model_Observer.php,
  includes\src\MSP_Common_Model_Feed.php


texts: Strange characters appear in admin category and header cart.

texts:
I am facing a very strange problem:

Whenever I go to catalog/category in admin area:

"c" letter is appear at the first, I know it cause this problem but I don't know how it was appeared.

Otherwise, "c" letter also appear on frontend:

When I was trying to delete an item in minicart, the response html also have c letter.

Please any can help me ?.
My site: http://sites.magebuzz.com/wholesalersdirect. Enter the postcode as 2500 to redirect to product page.

Thanks you very much.


texts: Magento 2: How to Keep Next Options value selected while changing previous option value on configurable dropdown

texts:
Suppose, if i change value of test attribute, than color and demo should be pre-filled with earliest selected value.
Can Anyone Help me in this Problem?


texts: Setting up multiple stores. Configuring one of them causes immediate redirect and can't login/view default website

texts:
I set up a website: http://example.com

I set up three store fronts that don't exist yet without a problem.

I created the fourth (last) store front http://example4.com without a problem. This domain is actually a live site that is running on my server at the moment.

Immediately after I click save on the configuration page (changing http://example.com to http://example4.com on the base+link urls (secure+unsecure) I get redirected to example4.com (the live site).

If I try to go to the primary website http://example.com I get redirected to the live http://example4.com as well.  This prevents me from viewing the primary site and prevents me login into to Magento at all.

If I edit the values in core_config_data table and clear /var/cache/ I am able to get back to the primary site but trying to configure my 4th store immediately causes the problem again.

Any suggestions?  I need to be able to setup this last store in Magento before getting rid of the old site.

Edit : Not sure if it helps anything but changed http://example4.com to example5.com (which is a domain that is parked on top of my the same account that runs example.com).  So again I immediately get redirect to example5.com.  When I try to goto example.com/admin/ login page I get sent to the magento install/setup system on example5.com.

I have no idea whats going on.


texts: What is Difference Between Price, Special Price and Final Price in Magento?

texts:
In magento 1 and 2,

There's  price , special_price and final_price and I can't find the difference between them.


texts: Magento 2: addFieldToFilter check for NULL not working

texts:
I am trying to get the records from database which contains parent_item_id NULL value.

$order_ = $this->_objectManager->create('Vendor\Module\Model\Saleslist')
                    ->getCollection()
            ->addFieldToFilter(
                'order_id',
                $orderId
            )->addFieldToFilter(
                'parent_item_id',
                ['eq' => NULL]
            );

and also want to add the parent_item_id equal NULL or  ' ' string check.


texts: how to allow out of stock group product to place order magento 2

texts:
How to allow one of the product is out of stock in group product to place order magento 2
I have grouped product and in which i have 2 products one is out of stock and other is in stock and i am not able to add that group product in cart
Is there any possibility to add that group product in cart?
It shows me error "select quantity of the product(s)"


texts: Removing current product from Up-sells products section

texts:
I am editing "You may also be interested" section (Up-sells products section) in the Product Detail page. I need to remove the current product from "You may also interested" section.

Up-sells products section displays the current product of category product (which most viewed). But I have issue when I go to "You may also be interested" section on product detail page; the current product is also getting displayed on this. I just need to remove the current product from "You may also be interested" section.

Example:
I have 4 products in Up-sells section:

  Test1, Test2, Test3, Test4

I am getting this but when I go to Test1 product detail page, then I need to not display Test1 under "You may also be interested" section.

Here is the code I've used so far:

$products = Mage::getResourceModel('reports/product_collection')
    ->addAttributeToSelect('*')
    //->addAttributeToFilter('entity_id', array('neq' => $product_id))
    ->addViewsCount()
    ->joinField('category_id',
    'catalog/category_product',
    'category_id',
    'product_id=entity_id',
    null,
    'left'
)
    //->addAttributeToFilter('category_ids',array('finset'=>$category_ids))
    //->addCategoryFilter($category)
    ->setStoreId($storeId)
    ->addStoreFilter($storeId)
    //
    ->setPageSize(4)
    ->addAttributeToFilter('category_id', array('in' => $category_ids ));

Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);


texts: Render the Customer Account Navigation Phtml file?

texts:
I have tried to show the Customer Navigation menu in Custom template file.

Below is My Code:

<div id="customer_menu">
<?php echo $this->getLayout()->createBlock('customer/account_navigation')->setTemplate('customer/account/navigation.phtml')->toHtml();?>
</div>

The menu is not loading well. Showing like below image

Any suggestions will be appreciated.

Thanks,


texts: Pagination for catalog product list using SOAP V2 API

texts:
I'm developing an Android app for e-commerce by accessing Magento's SOAP V2 API. I want to show all the products with image and info of all the products in Android.

I'm using catalogProductList SOAP V2 API to get products ID from Magento. From product ID's I need to get product images and other info. I can't to do all these things at once. So How can I restrict response of catalogProductList API to get first 10 or 20 products ID's and iterate through the response of SOAP?


texts:
I've to a Magento 1.9.0.1 site running that's started randomly 302 redirecting users to localhost.  The site's been running for about 2.5 years now and this issue just started happening yesterday.  The symptoms I've seen so far are

a web page will randomly redirect to localhost
admin pages work mostly fine with the occasional redirect, but this happens much less frequently than the frontend
it comes and goes.  sometimes all that'll happen is I'll get redirected and then sometimes it won't occur for long periods of time
when a page would load, links would get populated with localhost (i.e. localhost/myaccount or localhost/someCategory

Here's the things I've checked so far

make sure secure and unsecure base urls are correctly set - they are
flush cache and reindex everything to see if a bad setting got stored somewhere - didn't help
check .htaccess for redirects - none present other than ones that have been live for a year or more
check Apache config for redirects/rewrites  - none present
point to each app server individually to see if the problem was localized to a single server - it occurred on both app servers

The other odd thing is that when the issue first started yesterday, it was extremely intermittent.  But then the problem got worse until everything on the site, except the admin section, was redirecting to localhost.  However, towards the end of the day, the problem seemed to go away.  Now today, it's back to being extremely intermittent, although it doesn't seem to be getting worse...thankfully.

I was tempted to say it was something in the database, a SEO setting or a redirect setting in magento because I could go into index.php and set it to echo hello world and then exit and never once got redirected.  It wasn't until Mage::run was called that the redirect occurred.  To test that though, I made a copy of my database that I could point my local build to with the idea of stepping through things in the debugger to find where the redirect was coming from, but the copied database worked fine.

Then this morning, I noticed some weirdness in some of the RedisSession settings we use that I cleaned up and fixed that seemed to maybe help with the redirecting, but I'm not 100% sure.

So at this point I'm feeling better about the site, but since I don't know a root cause yet I can't say the issue is fixed.  Anyone have any ideas about what might be going on or things that I could check that might cause the issue described above?

EDIT: Not sure if this is relevant, but the redirect issue just came up again to the point where everything was always redirecting to localhost.  Interestingly, I flushed cache and session data in var/session and in Redis, and now the site is back without any problems.  Not sure if it's related, but it made me raise an eyebrow.

EDIT 2: The issue came up once more yesterday and that time I put the site into maintenance and flushed the cache and sessions that I've got in Redis, the sessions that were on disc, and truncated the core_sessions table.  That seemed to do the trick.  The site came back up and I haven't seen anymore redirects since then.  What's bothering me is that why would screwy sessions data cause the site to redirect like that?


texts:
I'm trying to install Magento 1.9.3 but got stuck on PHP extension mcrypt must be loaded.

I have two versions of PHP (5.6, and 7.1) both have mcrypt installed and running,
checked on both versions with

./php -m

mcrypt is in the list of running extensions, also added additionally in the

/ect/php.ini extension=mcrypt.so

I don't know what else to do to make it pass that installation screen.


texts: How do I make specific shopping cart price rule active at certain time?

texts: I have setup a shopping cart price rule in the magento back-office and I want to make it active automatically at certain time on certain day. is it possible ?


texts: Merge custom product attributes options in one

texts:
I have many product custom attributes all have same type dropdown for brand like

brand_cosmetic
cos_acc_brand
face_brand
mobile_brand

They have lot of options. i want to make a new attribute name product_brand and want to merge all above attribute options in it is there any way in magento to do this programmatically. I have searched alot but didn't find any solution.


texts: MSRP value incorrect for simple products with custom options

texts:
can someone help me figure this out

I've modified catalog/product/view/type/default.phtml as per:
http://www.magentocommerce.com/boards/v/viewthread/261633/P15/

<?php $_price = $this->helper('tax')->getPrice($_product, $_product->getMsrp()) ?>
<?php if ($_product->getMsrp()): ?>
    <?php $_msrpPrice = $this->helper('core')->currency($_product->getMsrp(),true,true) ?>

    <?php echo $this->__('Manufacturer\'s Suggested Retail Price'); ?>
    <span class="old-price" id="product-price-<?php echo $_product->getId() ?><?php echo $this->getIdSuffix() ?>"><?php echo $_msrpPrice ?>

<?php endif; ?>

This adds the MSRP into the product page as expected, however for some products the value being shown is not the same as the one entered into the attribute in the backend:

It looks like Configurable products have the correct value until an option is selected, then MSRP changes to be the Price.
Some Simple products with custom options are showing price as MSRP and also adding the cost of the custom options when selected.
Other Simple products with custom options are working fine.
Simple products with no options are showing the correct MSRP.

All products are showing the MSRP correctly in Category pages.

I'm completely stumped, any ideas?


texts: Magento 2: Internal link on product detail page to tab

texts:
I have a series of custom tabs on a Magento 2 product details page that were setup via the catalog_product_view.xml file.

I am trying to setup a button that will allow me to link from the short description area to additional tab.

If I do a brand new request to Additional - it works fine, but reloads the entire page.

If I do an internal link to Additional it does not work.

Any help is greatly appreciated.


texts: Magento 2 - Where is the value of locale in Magento system?

texts:
In Magento 2, Where is the value of locale in Magento system? Ex: from database or machine, or some place.

In file: Magento\Framework\Stdlib\DateTime\Timezone

/**
     * {@inheritdoc}
     */
    public function getDateFormat($type = \IntlDateFormatter::SHORT)
    {
        return (new \IntlDateFormatter(
            $this->_localeResolver->getLocale(),
            $type,
            \IntlDateFormatter::NONE
        ))->getPattern();
    }

  focus this line: $this->_localeResolver->getLocale()


texts: What am I doing wrong on this conditional?

texts:
I've put together a blurb to show logged out customers what they can pay if they create an account and log in.

Some of our products don't have a lower price so I want to omit the blurb for products that don't have a lower price when logged in. I tried a conditional to look for conditions where the product prices were different between the two states.

<?php if(!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
<?php $_productA = $this->getProduct();
$_productB = Mage::getModel('catalog/product')->load($_productA->getId());
$_productB->setCustomerGroupId(4);
if ($_productB != $_productA ) {
echo '
If you were logged in,
your price would be: $'.round($_productB->getFinalPrice(),2).'
';
} ?>
<?php endif; ?>

But it shows the code on every product. What am I missing?


texts: Magento 2 - Single Time Picker error on save

texts:
I have already added new form field - time picker.
When I'm trying to save form, post value is overridden on "Invalid date".

  <field name="flight_hour" formElement="date" sortOrder="40">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">flight</item>
                <item name="options" xsi:type="array">
                    <item name="timeFormat" xsi:type="string">HH:mm</item>
                    <item name="showsTime" xsi:type="boolean">true</item>
                    <item name="timeOnly" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
        <settings>
            <dataType>text</dataType>
            <label translate="true">Flight hour</label>
            <dataScope>flight_hour</dataScope>
            <validation>
                <rule name="required-entry" xsi:type="boolean">false</rule>
            </validation>
        </settings>
    </field>

This is error in my XML or core bug ?


texts: Disabling a Sonassi extension causes Magento admin panel not to load and errors out

texts:
Magento CE 1.8.0.0

Working on a new client's site and I've been assigned the task of disabling and removing Sonassi WordPress Deluxe extension. I proceed to edit app/etc/modules/Sonassi_WordpressDeluxe.xml by changing active from true to false, then I clear cache. The frontend of the site continues to operate normally but when I attempt to access the admin URL, Magento renders the homepage with a new message showing in a Mage_Core_Block_Messages block that says:

Magento has detected a fatal error (get_class() expects parameter 1 to be object, boolean given)

None of my var/ logs or PHP logs show any reference to this and the full page from header to footer loads. To me this implies that they have copied some of the extension code into the theme directories but I'm not sure. What is the most effective way to proceed with debugging?


texts:
I have the following Observer set up and can get the OrderID but not the customer name. Here is what I have:

namespace Veratad\AgeVerification\Observer;

    use Magento\Framework\Event\ObserverInterface;

    class ProcessOrder implements ObserverInterface
    {
        public function execute(\Magento\Framework\Event\Observer $observer)
        {
            try {

                $order = $observer->getEvent()->getOrder();
                $order_id = $order->getIncrementId();
                $fn = $order->getCustomerFirstname();
                $ln = $order->getCustomerLastname();

                $order->setVeratad($fn);
                $order->save();
            } catch (\Exception $e) {
                error_log($e->getMessage());
            }
        }
    }


texts: In the category page if i click the add to cart button need to redirect into the specific product page in magento 2.3.2

texts:
I need to redirect the specific product page when i click the add to cart button in the category page. instead of add the product to the shopping cart in magento 2.3.2

If anyone know the answer please share the exact code and folder structure since i'm new to magento.


texts:
I have an issue that when someone puts an item in the shopping cart, the cart empties itself very quickly and erases everything they had in the cart. This needs to not happen, when a customer puts products into the cart, they need to stay in the cart for weeks at a time.
The longest an item stayed in my cart for was 1.5 days.
what can be the reason?
please advise.

I set up "Quote Lifetime (days)" to 7 at Admin->System->Config->Sales->Checkout->Shopping cart

Thanks


texts: How to get product id from product url in magento 2

texts:
In Magento 1, I was able to get the product id from the product url:

$product_id = Mage::getModel('core/url_rewrite')
                ->setStoreId(Mage::app()->getStore()->getId())
                ->loadByRequestPath(basename($url))
                ->getProductId();

But I can't find similar solution in magento 2. Is it possible ?


texts: Magento 2 : Difference between Magento 2.1.1 and Magento 2.1.2?

texts:
Magento 2 has released the new community edition version 2.1.2. I  am very curious to know the difference with previous Magento edition ?

I want to know the full detail of the new feature introduced in new Magento version 2.1.2.

Also want to know if is there any bug(pending or new) with the latest version 2.1.2.

  Did anyone encounter any problems or bugs after upgrade/install new version of Magento 2.1.2 ?


texts:
di.xml code of my module

<?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\ConfigurableProduct\Block\Product\View\Type\Configurable" type="Namespace\Modulename\Block\Product\View\Type\Configurable" />
  </config>

Block file Configurable.php as below:

<?php

namespace Namespace\Modulename\Block\Product\View\Type;

class Configurable extends \Magento\ConfigurableProduct\Block\Product\View\Type\Configurable
{
    public function getAllowProducts()
    {
        exit('test');
    }
}

Any help would be much appreciated.


texts:
I have a Magento module that implements some forms of sending, and these send forms come from an API, I wanted to be able to put a photo next to the checkbox of each method. as in the example image. I did not want to tamper with the internal structure of Magento, since this is a custom module and the client will install it alone.

Each red square would be a photo. Sorry for any translation error. thanks to who to help me.

Magento 1.9


texts: I have bought bundle option image extension https://bsscommerce.com/magento-2-bundle-option-image-extension.html to use in my https://adarccomputer.com/newpc.html .though i have tried many times the bundle image is not appearing on my site.i do want to make it look similar to https://www.dinopc.com/gaming-pcs/primal-range/aardonyx-gr2-gaming-pc . please help me resolve the issue or suggest me ways to get it done by expert.I am new to magento and doesnt know much of its features so kindly help.I am also attaching how it appears on my end.


texts:
I am working on enabling persistence using the built in admin settings. I enabled persistence and remember me options, and set the session time to a month. The issue is it seems to only be partially working.

On my site if you are not logged in you cannot see pricing, and you see login and account creation on the homepage when you are not logged in, and see a different homepage if you are logged in.

If I log in with persistence enabled, and come back after a few hours, I come back to a psuedo logged in state. I can see pricing, and where it normally says "Welcome USER" I see the "Not USER?" prompt. But I see the logged out homepage, ie the login and account creation links instead of the logged in homepage. In addition, I can add items to my cart (normally restricted to non-logged in customers), but when I move to checkout it prompts me to login.

So I seem to be in some psuedo logged in state, and I cannot figure out why this is. I want to have persistence enabled, but I want it to leave a user fully logged in, not partially logged in as seems to be the case.

Any ideas what may be causing this issue?


texts:
I want to create new customer section example sampleorder

url like : customer/account/sampleorders/

I tried below method that is working but it is the wrong way to modify core Magento files, what I tried is below, but I want to do it via module

1: create a file Sampleorders.php

vendor/magento/module-customer/Controller/Account/Sampleorders.php

<?php
namespace Magento\Customer\Controller\Account;

class Sampleorders extends \Magento\Customer\Controller\AbstractAccount
{

   /**
  * Index Action*
  * @return void
  */
  public function execute()
  {
       echo "hellow";
      exit();

  }
}


texts:
I have email confirmation for customers enabled.

I am receiving emails on registration but after I click the email confirmation link, it directly redirects to login page and if I enter the login details I still says the account is not activated and check the email.

Edited:

This is the url which I am receiving in the hyperlink in "confirm account" email. Not sure if this is correct.

http://synergo.com.sg/sample/ergoshop/apple_sg/customer/account/confirm/?back_url=%3A%2F%2F%2Fcustomer%2Faccount%2Fconfirmation%2Femail%2Fbala%40mindlens.com.sg%2F%3FSID%3D9f0daf4310b7e778ba44c6785f3af7de&id=28&key=855732f3353ac274e7e6ab45c890a16a"


texts: Magento 2: How long should Unit, Integration and Framework Tests take to run on an unmodified site;

texts:
Magento 2: How long should Unit, Integration and Framework Tests take to run on an unmodified site.

I am experiencing 10 - 15 minutes for PHPUnit tests

Integration tests run for hours and hours... I gave up at 7 hours in.

Haven't tried framework tests.

I'm think that I have configuration issues with my Docker based system that I need to get a dev-ops person to investigate, but before I do I'd like to know how long a well configured system would take?


texts: Why is cache being saved to the file system when Redis is configured as the cache backend?

texts:
I'm using a call to Mage::getSingleton('core/cache')->save() within a controller of mine and it's saving the cached value to the file system (var/cache/) even though Redis is configured as my cache backend, and seemingly all other cache in Magento is being saved properly to Redis.

Here's the save() call:

Mage::getSingleton('core/cache')->save($imageUrl, $cacheKey, array(Mage_Core_Model_Config::CACHE_TAG));

Here's my app/etc/local.xml:

<cache>
    <backend>Cm_Cache_Backend_Redis</backend>
    <backend_options>
        <server>redis11.i</server>
        <port>6379</port>
        <database>2</database>
        <password></password>
        <persistent>cache-db2</persistent>
        <force_standalone>0</force_standalone>
        <connect_retries>1</connect_retries>
        <automatic_cleaning_factor>0</automatic_cleaning_factor>
        <compress_data>1</compress_data>
        <compress_tags>1</compress_tags>
        <compress_threshold>20480</compress_threshold>
        <compression_lib>gzip</compression_lib>
    </backend_options>
</cache>

Why is it saving that cached value to the file system instead of Redis?


texts: cannot update php on ubuntu 16.04 from php7.1.2 to php 7.1.3

texts:
I have a magento 2.2.2 and want to update to magento 2.3. The problem is my version of php. Currently I have php7.1.26 while magento 2.3 is compatible only with php 7.1.3+. The solution seems easy: upgrade my php version to 7.1.3. My problem is that I cannot find a way to do this.

I first tried the usual way with the update command:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1

This switched my php version from php7.1.14 to php7.1.26. But I need php7.1.3 so this is not good. So I tried this:

sudo apt-get install php7.1.3

but this installed php7.2 instead. I need php7.1.3 so this is not good either.

So my question now is:

Is there a way to have a php version 7.1.3+ but not 7.2+ ?

Thanks


texts:
I have this static block:

VERTICAL   BLINDS COLLECTION

I manage to insert href links for some words but I also want to make the whole image inside this div class :

link. How can I insert in this div the href link please?


texts: Products not showing in category page and search result

texts:
The Products that I created, are not showing in selected category pages and not showing the search results. How can I fix this?

Products Properties:

Status: Enabled
Visibility: Catalog, Search
Inventory: Manage Stock: No (that's mean the product in stock)
Main Website: Selected
Product Categories: Selected

Categories Properties:

Is Active: Yes
Display Mode: Products Only
Is Anchor: Yes

Please note that when I entered the URL key in the browser, the product page showing and its available, but the products are just not showing in category page and search result.

Thank you in advance.


texts: How to create the an ajax call to return spConfig json with product sku (product options)

texts:
I'm using Varnish on my magento build and I want to Ajax the product options.

I've noticed that there is a json line in spConfig on the product page.

How would I go about creating a php ajax call e.g.

localhost/get_json_options.php

<?php

echo $this->getJsonConfig($sku / $product_id);

?>


texts: Apply cart rule to products without other discount

texts:
Scenario:
Add a new condition to the cart rules in the section "Apply the rule only to cart items matching the following conditions".
The condition should like this: "If Absolute discount amount is/greater/... {value here}".

Example:"Absolute discount amount is 0".
This means that the item should not be matched if it already has a discount.
Adding the new condition was fairly easy.
I added a plugin on Magento\SalesRule\Model\Rule\Condition\Product.
afterLoadAttributeOptions

public function afterLoadAttributeOptions(\Magento\SalesRule\Model\Rule\Condition\Product $subject, \Magento\SalesRule\Model\Rule\Condition\Product $result)
{
    $attributes = $subject->getAttributeOption();
    $attributes['quote_item_absolute_discount'] = __('Absolute discount amount');
    asort($attributes);
    $subject->setAttributeOption($attributes);
    return $result;
}

This makes it appear in the backend and behave as it should

Now I tried to validate my new condition:
In the same class I have this around plugin

public function aroundValidate(Product $subject, callable $proceed, \Magento\Framework\Model\AbstractModel $model)
{
    if ($subject->getAttribute() === 'quote_item_absolute_discount') {             //if not checking on quote item, let the original method execute
        if ($model instanceof \Magento\Quote\Model\Quote\Item) {
            //set the value of the absolute discount to the product and let the original method validate it
            $model->getProduct()->setData('quote_item_absolute_discount', $model->getDiscountAmount());
        }
    }
    return $proceed($model);
}

I did this for other conditions and it works nicely.
But in this case, because the rules validation is a separate process from applying the rules, I always get 0 for $model->getDiscountAmount().
Even if there are other rules applied to the cart before my rule, the validation is done before applying all the other rules.
Any idea on how I can make this work?


texts: Magento can't open a file outside its base dir with fopen

texts:
For some reason to me unknown, Magento doesn't want to open file for writing with:

$fp = fopen("/Users/vlado/Desktop/f.txt", 'a+');

, apparently because it is outside of the Magento base directory. In other words, this works:

$fp = fopen("media/f.txt", "a+");

Both files /Applications/XAMPP/htdocs/magento/media/f.txt and /Users/vlado/Desktop/f.txt have 777 chmoded to them. Does anyone know why is this happening?


texts: Magento 2.1.6 : Exception For Writing Image Files on Local Wamp , Log is Given in Comment Box

texts:
main.CRITICAL: exception 'Magento\Framework\Exception\FileSystemException' with message 'Directory "D:/UwAmp/www/magento2_1_6/D:" cannot be created Warning!mkdir(): Invalid argument' in D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php:225
Stack trace:

0 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

1 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

2 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

3 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

4 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

5 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

6 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

7 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

8 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

9 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

10 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(218): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

11 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Driver\File.php(199): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('D:/UwAmp/www/ma...', 511)

12 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Filesystem\Directory\Write.php(89): Magento\Framework\Filesystem\Driver\File->createDirectory('D:/UwAmp/www/ma...', 511)

13 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Image\Adapter\AbstractAdapter.php(684): Magento\Framework\Filesystem\Directory\Write->create('/D:/UwAmp/www/m...')

14 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Image\Adapter\Gd2.php(141): Magento\Framework\Image\Adapter\AbstractAdapter->_prepareDestination('\\D:/UwAmp/www/m...', NULL)

15 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Image.php(79): Magento\Framework\Image\Adapter\Gd2->save('\\D:/UwAmp/www/m...', NULL)

16 D:\UwAmp\www\magento2_1_6\vendor\magento\module-catalog\Model\Product\Image.php(677): Magento\Framework\Image->save('\\D:/UwAmp/www/m...')

17 D:\UwAmp\www\magento2_1_6\vendor\magento\module-catalog\Helper\Image.php(465): Magento\Catalog\Model\Product\Image->saveFile()

18 D:\UwAmp\www\magento2_1_6\vendor\magento\module-catalog\Helper\Image.php(534): Magento\Catalog\Helper\Image->applyScheduledActions()

19 D:\UwAmp\www\magento2_1_6\vendor\magento\module-catalog\Block\Product\ImageBuilder.php(132): Magento\Catalog\Helper\Image->getResizedImageInfo()

20 D:\UwAmp\www\magento2_1_6\vendor\magento\module-catalog\Block\Product\AbstractProduct.php(517): Magento\Catalog\Block\Product\ImageBuilder->create()

21 D:\UwAmp\www\magento2_1_6\vendor\magento\framework\Interception\Interceptor.php(146): Magento\Catalog\Block\Product\AbstractProduct->getImage(Object(Magento\Catalog\Model\Product\Interceptor), 'new_products_co...', Array)


texts: Magento 2 - How to call custom attribute saved in a phtml file and display it?

texts:
I want to display some text after product price. For example $35 per kg. this text "per kg" I want to append on some products which I am selling on kg basis.

I have created a custom attribute with textfield. I have inserted value per kg into that attribute and assigned with the product I want it to be displayed.

Now my problem is I am not getting any way to call this custom attribute to append to price on frontend. I want this text to be displayed on both category and display page.

I am trying to edit:
vendor\magento\module-catalog\view\base\templates\product\price\amount

I can display custom text by echo but not getting any way to call that custom attribute. code of custom attribute is per kg.


texts:
I use Magento 2 Land of Cooder Market Place. I got a dashboard error https://prnt.sc/u6b8cr
Fatal error: Uncaught Error: Cannot instantiate abstract class Magento\Framework\Model\ResourceModel\AbstractResource in /home/427182.cloudwaysapps.com/gravqhssbb/public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50 Stack trace: #0 /home/427182.cloudwaysapps.com/gravqhssbb/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') #1 /home/427182.cloudwaysapps.com/gravqhssbb/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(144): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...') #2 /home/427182.cloudwaysapps.com/gravqhssbb/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'resource', 'Lof\\MarketPlace...') #3 /home/427182.cloudwaysapps.com/gravqhssbb/public_html/vendor/magento/framework/ObjectMan in /home/427182.cloudwaysapps.com/gravqhssbb/public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50


texts:
We built a controller module that extends the Mage_Cms_IndexController and detects when certain no-route conditions are met, changes the handle and loads the new page

$update = $this->getLayout()->getUpdate();
$this->loadLayout();
$update->addHandle('specialpage_result_index');
$this->loadLayoutUpdates();
$this->generateLayoutXml()->generateLayoutBlocks();
$this->renderLayout();

The controller works perfectly, detects the conditions it needs and handles the load to the special page. A problem happens when we turn on the "LAYOUT_GENERAL_CACHE_TAG" (Layout) caching and it never renders our new page. We get a default blank CMS page instead of our targeted page. The issue obviously has something to do with the caching on the site, but we cannot figure out how to load the page each time without the cache affecting it. Can someone please let us know how to load the page without the caching affecting it? We have tried adding the noCache keys into the local.xml file, however that does not work either.


texts: Dynamically set client id in checkout to be used in payment process

texts:
I'd like to ask a question related to a community extension, but about how to specifically extend that extension. The extension developer's support doesn't extend this far.

It's a payment module in the checkout. In system->config->payment methods there is a field within the credit card section for client ID. I need to set it up so instead of being able to provide one client ID to the payment service as it is just now, I need the plugin to be able to handle multiple client IDs, one for each of our business partners.

So for example, a customer buys a product on the site, which belongs to one of our partners (id of 1), then the client ID sent to the payment service should be for partner 1. A product of partner 2 should send to the payment service the equivalent client id 2.

Looking at the extension code, I found the client_id section within etc/system.xml, allowing us to set the client id in admin.

Also in Model/Observer.php I can see

$clientId = Mage::getStoreConfig('payment/'.$payment->getMethod().'/client_id', $storeId);

This is overly simplistic, but could I somehow

Add extra sections within system.xml for each client ID I required, so these can be entered in admin (e.g. client_id1, client_id2)
When a product goes to checkout, use the observer to get the partner id of the product to set client id (e.g. client_id1, client_id2) to be sent to the payment service?

Or would there be a better/correct way to approach this, perhaps as a separate local extension?


texts: Magento 2 : How to change html/css classes of onepage checkout in custom theme

texts:
I'm creating a new theme from scratch, I would like to change the html code of the checkout/#shipping page. However, the template (Magento_Checkout/onpage.phtml) containing the html code that I would like to change contains mostly javascript.

I couldn't figure out where the html code in this template is located. Is it defined in a .js file?

What is the best way to modify the html classes of the elements in this template and change its layout?

Thanks for reading.


texts: Magento 2: All Products Not Displaying In Admin

texts:
I have more than 5K products. Suddenly don't know what happen now on Admin Side

In Admin -> Products -> Catalog now it's displaying only 1K products.

All Filters are also Reset. Visibility All Ok for Product.

When i Export from Admin .CSV file has 5K products. On Frontend also it's displaying 5K products.

Done with Indexing & Caching. Check Product Status as Well.

Don't know where is the issue?

[UPDATE]

I have delete all records & import it again. It's working fine now :)


texts: Where to find Table for data getPreconfiguredValues

texts:
I notice that when I try to update a custom value in Checkout/Cart the custom options selected is correct and is updated. Then when I visit the checkout/cart/configure/id/{quoteid}/product_id/{productid}/ it's still displaying the old Custom Option I selected before I did the update which is not correct. Now I've traced the code and found this
namespace Vendor\Module\Block\Product\View\Options\Type;

class Select extends \Magento\Catalog\Block\Product\View\Options\Type\Select
{
    /**
     * Return html for control element
     *
     * @return string
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function afterGetValuesHtml(\Magento\Catalog\Block\Product\View\Options\Type\Select $subject)
    {

        $_option = $subject->getOption();
        $configValue = $subject->getProduct()->getPreconfiguredValues()->getData('options/' . $_option->getId());
        $store = $subject->getProduct()->getStore();
        $subject->setSkipJsReloadPrice(1);

So the culprit is this line of code $subject->getProduct()->getPreconfiguredValues()->getData('options/' . $_option->getId()) may I know where can I find the table being retrieved by this line of code? Where does getPreconfiguredValues points to? And why it's still returning the old selected value.
Update:
I found out that the value being returned is possibly from quote_item_option with code info_buyRequest. Upon checking the value it returned this
{
"id": "726000",
"undefined": "undefined",
"product": "3611",
"selected_configurable_option": "",
"related_product": "",
"item": "726000",
"options": {
"4298": "11831"
},
"qty": "1",
"reset_count": true
}
So option: {4298: 11831} is the old selected dropdown value the new value is 11832

So now the question is why it's not updated when I did the changes in checkout/cart page?  Why it didn't update this row? are there any reason that it's retaining the old selected value?


texts: Magento 2.3.4 EE Companies edit not finding the company

texts:
I am trying to edit companies using the "Edit" link at the right of the grid of companies.

The link the link is trying to get to is as follows

/admin/company/index/edit/id/4/key/xxxxxxxxxxxxxxxxxxxxxxxxxxx

The id number is valid when I look in the company DB table. I have tried this for any of the companies and I get the same result.

I am getting an exception thrown

  The requested company is not found

I have started to work my way through the code in the /vendor/magento/module-customer module and I am about to start code tracing to see what is going on.

Has anyone else come across a similar situation where the company is not found when trying to edit? I am asking to try to save myself hours of hair pulling


texts:
I was asked to add a taxonomy attribute.  I now that could be thought that it is way to broad so I'll try to do my best to lay out everything as this question evolves. The demand from them is that they don't want the categories or tags to be used for this as they are using this already.  What they want is to basically have the category tree that is in the product edit page tab to be reproduced with custom data in a new tab called "taxonomies".  I have bee trying to plot out how to best approach this but I'm running in circles here.

The conditions are:

The values are to be searchable
The existing category system is not to be replaced (in other words a solution is not "why not use the categories?")
It must have hierarchy
if possible have a url for the taxonomy value (yeah I know)

Basically I have just been asked to reproduce the category system.  :\ I have been reading around and found many examples of setting the category tree selector in extensions, Add Category tree in custom extension for example.  None of the examples are leading me to what the solution should look like.

Here are possible solutions I have been running down.

A new extension that sets a EAV attribute maybe?
try to copy the whole category system under a new name scope?
???

I'm not really sure where the best path is but it I know it'll be a long one.

The short of this is, how can I do what wordpress does I guess.  This is where the boss people have picked up the idea and are steadfast on "this is a must".


texts: Add custom field to order in admin backend and allow to change it

texts:
I want to add a custom checkbox to all orders that is by default deactivated, allow the admins to change the value of this field in the backend and filter the grid by this!

What I have so far is:

Module config:

<?xml version="1.0"?>
<config>
    <modules>
        <demo_OrderCheckbox>
            <version>1.0.0</version>
        </demo_OrderCheckbox>
    </modules>
    <global>
        <resources>
            <Ordercheckbox_setup>
                <setup>
                    <module>demo_OrderCheckbox</module>
                    <class>demo_OrderCheckbox_Model_Resource_Setup</class>
                </setup>
            </Ordercheckbox_setup>
        </resources>
    </global>
    <adminhtml>
        <layout>
            <updates>
                <demo_OrderCheckbox>
                    <file>demo/ordercheckbox.xml</file>
                </demo_OrderCheckbox>
            </updates>
        </layout>

    </adminhtml>
</config>

The setup file:

<?php
$installer = $this;
$installer->startSetup();
$installer->addAttribute("order", "handled", array("type" => "checkbox", 'label' => 'Order handled', 'visible' => true, 'required' => false, 'is_user_defined' => true,));
$installer->endSetup();

The demo/ordercheckbox.xml:

<?xml version="1.0" ?>
<layout>
    <sales_order_grid_update_handle>
        <reference name="sales_order.grid">
            <action method="addColumnAfter">
                <columnId>handled</columnId>
                <arguments>
                    handled
                    <index>handled</index>
                    <filter_index>handled</filter_index>
                    <type>checkbox</type>
                </arguments>
                <after>shipping_name</after>
            </action>
        </reference>
    </sales_order_grid_update_handle>
    <adminhtml_sales_order_grid>

        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_grid>
    <adminhtml_sales_order_index>

        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_index>
</layout>

In the grid, there is a new field, but it is checked for every order and if I try to filter by it, there is an error a:5:{i:0;s:85:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'handled' in 'where clause'";i:1;s:6103:"#0 /home/web/htdocs/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)

How do I get this to work?
Then I need to make it changeable in the detail view.
I added this code to app/design/adminhtml/default/default/template/sales/order/view/form.phtml

<?php
$_order_id = $this->getRequest()->getParam('order_id');
if ($_order_id>0):
$_order = Mage::getModel('sales/order')->loadByIncrementId($_order_id);
$isHandled=$_order->getHandled();
?>

Already handled  <input type="checkbox" name="handled"<?php if($isHandled) { echo ' checked '; } ?> value="true" id="handledCheckbox">

<?php
endif;

I plan to add a method to change this value to my module and call that method using AJAX!

Should my approach work after I fix the errors/problems or am I completely on the wrong track?


texts: magento 2 checkout page shipping address validation not working after applying advanced js bundling

texts:
I have applied advanced js bundling. Everything works fine except shipping address validation on the checkout page.
After applying bundling checkout page shipping address validation is not working for new customers (mean if an address is not added before and someone fills shipping address on checkout page). Like it shows errors if the phone is empty but it also proceeds to the next step

It is showing phone number is a required field but at the same time it goes to the next page.

Update:
After further investigation i found that in abstract.js this.source() is null thats why it is not going inside if condition.

without advanced js bundling this.source is not null and it runs this statement this.source.set('params.invalid', true);


texts: Moving magento1.9 site to new server and domain causes css not to load?

texts:
We moved a magento 1.9 based site to a new server and a new domain name. now when we go to the site most of the images and pages load. However no css or js seem to be loading and doing a view source I see the links to css files are missing the /skin/ in the url ??

I made sure in the core_config_database that there is an ending slash on the sites url. However i am not sure what else i am missing? I do see a .htaccess file in the magento root folder.


texts: Magento2 : How to connect third party ERP system with Magento system

texts:
I'm working on Mageno2 module, which is connect to Infor ERP system.

How to get data from Infor to Magento system or Magento to Infor system?

Any documents or third party extension available for it.

If anyone have knowledge about it, please share your thought on it.

Any help would be really appreciated.


texts:
enter image description here

Hey Guys! I am new to magento and after installing a theme  what happens is in the product catalog grid the products are not alligned and in the product page the add to cart and other options go down instead of right after the image. But when I minimize the window it looks fine. See the images for reference. The first image every product on the grid have add to cart not aligned. It is sever when the price is 4 digit and after the offer price it goes down. The second and third image have also allignment problem. Please help!


texts: Why is it returning empty products collection after some category changes?

texts:
I have these code on my homepage:

list_home.phtml:

$_productCollection = Mage::getResourceModel('catalog/product_collection')
                ->addAttributeToSelect('*')
                ->setVisibility(array(2,3,4))
                ->setOrder('created_at', 'desc')
                ->setPage(1, 48);

list_featured.phtml:

$preorderAttribute = 'featured';
$preorderValue = 'Yes';

$_productCollection = Mage::getResourceModel('catalog/product_collection')
                ->addAttributeToSelect('*')
                ->addAttributeToFilter($preorderAttribute, array(
                    'eq' => Mage::getResourceModel('catalog/product')
                        ->getAttribute($preorderAttribute)
                        ->getSource()
                        ->getOptionId($preorderValue)
                ))

                ->setVisibility(array(2,3,4))
                ->setOrder('created_at', 'desc')
                ->setPage(1, 12);

Both of which are called from the 'home' CMS page with this:

Best Sellers!

{{block type="catalog/product_list" category_id="4" template="catalog/product/list_featured.phtml"}}

Newest Additions!

{{block type="catalog/product_list" category_id="4" template="catalog/product/list_home.phtml"}}

But after some category changes, e.g. adding some categories and moving them in order or descendence, the homepage suddenly gives nothing as you can see.

I'm totally at a loss. Thus far I tried changing category_id to other categories, refreshing the caches, etc. but nothing worked.

The template code in the .phtml files seems fine to me.

Why is this happening? How to fix this?


texts: Magento does not redirect to payment success page

texts:
I'm using Airpay Payment Gateway. I'm able to checkout and redirect  to payment provider page. Money gets deducted. But

After payment, it redirects to homepage instead of order success page and logs out of session. I need to login again
When i go to orders section, it is showing payment pending

When i check the same with COD orders, it redirects to success page with order ID.
We have provided call back url to payment provider as
site.com/index.php/checkout/onepage/success/
Is this a issue with the payment gateway provider end or do i need to change anything else in magento. We are using 2.3.5 version


texts: TypeError: image.elevateZoom is not a function: Failure in Magento 1.9 RWD theme

texts:
in Magento 1.9 CE, if we browse the product reviews page, it displays an error

TypeError: image.elevateZoom is not a function

This is becuase, magento is using image zoom in product page using this plugin

the JavaScript interpreter because of a failure shuts down on this page, JavaScript is not executed. This leads to decreased functionality of the page
Does anyone can help me on how to remove this error so that i can us js on this page???
These guys says, they have solved the problem, but i can't get the solution.


texts: Incorrect Location URL returned by V2 SOAP WSDL

texts:
When fetching the V2 WSDL via this URL:

www.example.com/shop/api/v2_soap?wsdl=1

It is defining the wrong URL for requests:

<service name="MagentoService">
  <port name="Mage_Api_Model_Server_V2_HandlerPort" binding="typens:Mage_Api_Model_Server_V2_HandlerBinding">
    <soap:address location="http://example.com/shop/index.php/?type=v2_soap"/>
  </port>
</service>

As you can see above, it is returning this URL:

www.example.com/shop/index.php/?type=v2_soap

Although it should be:

www.example.com/shop/index.php/api/v2_soap/index/

I've hunted down through a lot of the Magento core code and I believe that value get set in
    /app/code/core/Mage/Api/Model/Wsdl/Config/Base.php
around line 53:

    // set up default WSDL template variables
    $this->_wsdlVariables = new Varien_Object(
        array(
            'name' => 'Magento',
            'url'  => htmlspecialchars(Mage::getUrl('*/*/*', array('_query' => $queryParams)))
        )
    );

This part is what appears to be failing:

Mage::getUrl('*/*/*' ...

If I change that to:

Mage::getUrl('api/v2_soap/index' ...

the correct URL is returned.

This question appears to be describing the exact same problem, but there was never an answer for it:

How to fix Magento's incorrect Soap V2 location address

Thanks in advance for any help!

UPDATE

Although I've yet to find a permanent solution to this issue, I have found a temporary solution after searching around a bit. Essentially, I extend the SoapClient class and override the __doRequest method as a means of intercepting requests and tweaking the location URL before the request is sent:

class SoapClientLocation extends \SoapClient
{
    public function __doRequest( $req, $location, $action, $version = SOAP_1_1, $one_way = NULL )
    {
        $location = str_replace( '?type=v2_soap', 'api/v2_soap/index/', $location, $one_way );
        return parent::__doRequest( $req, $location, $action, $version );
    }
}

 $this->client = new SoapClientLocation( $this->config['api']['url'] );


texts: Get product attribute in ui component form magento 2

texts: How do I get all product attribute in select option in the custom form in Magento 2. Do you have any idea.


texts: Magento 2: Add multiple products to cart programmatically does not work if cart is empty!

texts:
I have the same problem as mentioned in this Question: Magento 2: Add multiple products to cart programmatically But it was never answered. This is my Controller.php:

<?php

namespace MassiveArt\ShoppingCart\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\Data\Form\FormKey;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Checkout\Model\Cart;
use Magento\Catalog\Model\Product;

class Index extends Action
{
    /**
     * @var FormKey
     */
    protected $formKey;

    /**
     * @var Session
     */
    protected $checkoutSession;

    /**
     * @var Cart
     */
    protected $cart;

    /**
     * @var Product
     */
    protected $product;

    /**
     * Constructor.
     *
     * @param Context $context
     * @param \Magento\Checkout\Model\Session $checkoutSession
     * @param \Magento\Customer\Model\Session $customerSession
     * @param JsonFactory $resultJsonFactory
     * @param FormKey $formKey
     * @param Cart $cart
     * @param Product $product
     */
    public function __construct(
        Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Customer\Model\Session $customerSession,
        JsonFactory $resultJsonFactory,
        FormKey $formKey,
        Cart $cart,
        Product $product
    ) {
        $this->checkoutSession = $checkoutSession;
        $this->customerSession = $customerSession;
        $this->formKey = $formKey;
        $this->resultJsonFactory = $resultJsonFactory;
        $this->cart = $cart;
        $this->product = $product;
        parent::__construct($context);
    }

    public function execute()
    {

        try {

            // Set result data and pass back
            $result = $this->resultJsonFactory->create();

            if(!$this->customerSession->getCustomer()->getId()) {
                $result->setData(['error' => __('Invalid session ID')]);
            }

            // Get parameters
            $productIds = $this->getRequest()->getParam('productIds');
            $amounts = $this->getRequest()->getParam('amounts');

            for ($i = 0; $i < count($productIds); $i++) {// Load product by ID
                $product = $this->product->load($productIds[$i]);
                // New product params
                $params = array(
                    'form_key' => $this->formKey->getFormKey(),
                    'product' => $productIds[$i],
                    'qty'   => $amounts[$i],
                );

                // Save Product
                $product->save();

                // Add product to cart
                $this->cart->addProduct($product, $params);
            }

            //Save cart
            $this->cart->save();

            $result->setData(['message' => __("Products added succesfully")]);

            return $result;
        } catch(\Exception $e) {
            $result->setData(['error' => __($e->getMessage())]);
            return $result;
        }
    }
}

The code works fine, if the cart is not empty, but if the cart is empty only one product is added to cart with sum of quantity for all the product.

For eg if I add: Prod 1 - 2 quantity Prod 2 - 1 quantity
Cart will contain prod 1 with 3 quantity.

Please let me know how to solve this.


texts:
I have a popup Login/register. But when i click "add to wishlist" when not logged in it redirects me to a standard login page. I would like to change it to the login popup.

This is the header login/registration code:

<a href="http://x.com/x/customer/account/login/" title="Login / Register" id="login-popup">Login / Register


texts:
The first time I am hosting my Magento 2 version(2.3.4) website, I am facing here while uploading the product!

the error is :

Invalid value in Website column (website does not exist?) in a row(s): 1

and this is my CSV file sample file

I have downloaded this sample file from the import section only

I have tried many solutions on the internet

what is the problem here, What I suppose to give value for 'product_websites' ?


texts: I have created two users with certains access in BO and I found that when adding category or product even an article ( via an extension that I have already installed) I can't find the new rows added without launching certain command : indexer: reindex, flush cache so  it's a problèm for the client because he will fed up with reindexing his site every time his don't  find the updated changes so how to prevent this issue and do I have to install certain extension or what please any clear explanation and thanks in advance


texts:
I have this code:

<?php if($_product->isSaleable()): ?>

<?php echo $this->__('In stock:') ?>
    <?=(int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty() ?>
    <?php echo $this->__(' stk.') ?>

<?php endif; ?>

It works great for simple products, shows how many left.

But i also use configurable products. How can I get the code to get the stock of the simple product when the parent is a configurable? Now it shows 0.


texts: Magento 2 - code-migration XML_SERIALIZE issue

texts:
I am trying to use the code-migration tool provided officialy by magento2 to test the migration from M1 to M2 for extensions.

I setup everything great -composer,folders and so on-

I run the first command which is the convert

php bin/migrate.php migrateModuleStructure <src> <dst> - Migrate directory structure

and it works great. When i get to the second command

php bin/migrate.php convertLayout <dst> - Migrate layout

I get a fatal_error

  Error: Class 'XML_Serializer' not found in
  /home/test/public_html/src/Magento/Migration/Command/ConvertLayout.php
  on line 211

Any thoughts? Thank you


texts:
I've been doing some work in Magento 2 and have been overwriting some modules i've installed ( on the frontend ).

However today i've just come across something that I've not encountered before. The module I've been using has a block inside of it which has the following:

<referenceBlock name="product.info.details">
    <block class="Vender\Module\Block\Catalog\Related" name="posts.tab" as="blog.posts"
               template="Vender_Module::catalog/posts.phtml" group="detailed_info">
    </block>
</referenceBlock>

It sets its name:

  posts.tab

and then uses the as to allow it to be called via:

  as="blog.posts"

When i tried to reference the block to be removed using the as name I noticed that it wasn't removing it from the page:

<referenceBlock name="product.info.details">
    <referenceBlock as="blog.posts" remove="true"/>
</referenceBlock>

so i went to see what the page actually called in on the frontend ( just incase it was being renamed somewhere else or wasn't using the posts.tab name ) - the block name is being called in with posts.tab , which is fine as i can just reference that block to remove it. That worked fine.

But my question is, why isn't the block being pulled through using as and instead being pulled through using the name.

Secondly what is the point in the as, because obviously blocks can't have conflicting names anyway and should be unique - but i might be totally wrong.


texts: Disable array of days in magento 2 calendar not working on product view page

texts:
In my custom Module I am able to disable array of days using this code in viewproduct.phtml

However I added same code in my Theme Magento_Catalog/templates/product/view.phtml to work with product options choosing date is not working.

Any Idea or I am not doing it correct.

Here is my theme view.phtml

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile
?>

<?php
    $_config = $this->helper('Magetheme\Custom\Helper\Data');
?>

        <?php echo $block->getChildHtml('product.info.media'); ?>

        <?php echo $block->getChildHtml('product.info.main'); ?>

<?php echo __('Share')?>

        <?php echo $block->getChildHtml('detail.bottom'); ?>

    <?php
        $related = $block->getChildHtml('related.product');
        $upsell = $block->getChildHtml('upsell.product');
        //var_dump($upsell);
    ?>

    <?php if($_config->getProductDetail('show_related') || $_config->getProductDetail('show_upsell')){?>

        <?php if($_config->getProductDetail('show_related')){?>

                    <?php echo __('Related Products')?>

                <?php echo $block->getChildHtml('related.product'); ?>

        <?php }?>
        <?php if($_config->getProductDetail('show_upsell')){?>

                    <?php echo __('Upsell Products')?>

                <?php echo $block->getChildHtml('upsell.product'); ?>

        <?php }?>

    <?php } ?>


texts:
I want to Exempt / Exclude Tax for a particular customer group in Magento 2.2.
Could you pls help me out


texts: Magento 2.2.7 cron job issue finished without completed

texts:
We have added the following lines to the crontab file to run magento cron after every 1 minute.

* * * * * /bin/php -c /etc/php.ini /home/centos/public_html/staging/bin/magento cron:run > /home/centos/public_html/staging/var/log/magento.cron.log&

* * * * * /bin/php -c /etc/php.ini /home/centos/public_html/staging/update/cron.php > /home/centos/public_html/staging/var/log/update.cron.log&

* * * * * /bin/php -c /etc/php.ini /home/centos/public_html/staging/bin/magento setup:cron:run > /home/centos/public_html/staging/var/log/setup.cron.log&

We have created cron job for our module under magento default group which is to be executed after every 30 minutes.

<job name="auto_review_email" instance="MyCompany\ModuleName\Cron\AutoReviewEmail" method="execute">
    <schedule>*/30 * * * *</schedule>
</job>

But when we check in cron_schedule table and in our logs, cron job finished after 1 minute without executing completely. Please refer to below screenshot:-

We have tried using flock in crontab, checked the server timings but nothing worked.

Please advise. Thanks.


texts:
I have set the multiple select option in system configuration.
I need to get the selected values.
I used the following,
Mage::getStoreConfig('customer/group_location/data')

But I didn't get anything. Somebody help me

below is the system.xml code

<?xml version="1.0"?>
<config>
    <sections>
        <customer translate="label" module="customer">
            <groups>
                <group_location translate="label">
                    Group Location
                    <sort_order>200</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <data>
                            Group Location
                            <frontend_type>multiselect</frontend_type>
                            <source_model>customerattribute/attribute</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <can_be_empty>1</can_be_empty>
                        </data>
                    </fields>
                </group_location>
            </groups>
        </customer>
    </sections>
</config>


texts: Used coupon not displaying in admin order

texts:
I have generated shopping cart rule which is applied for free shipping. If other rules are applied then it's displaying in order details in admin but free shipping rules is not.

I need to know which rule is applied for free shipping in admin order details page.

https://www.screencast.com/t/QwkudKUAm3c4


texts: How to write tests when closures are involved

texts:
For learning purposes I was trying to write a unit test for one of my Magento 2 around plugins (interception).

The method I'm testing receives as parameter a \Closure object that cannot be mocked because \Closure is a final class

How do I proceed in this case? Create an actual closure in my test class and pass that as parameter? Or any other way?

Let's say my method looks like this. Ignore the content, focus on the concept.

class Something
{
    public function aroundDoStuff(SomeModel $subject \Closure $closure, $extraParam)
    {
        if ($subject->getSomeValue() == 1) {
             return 'Custom return';
        }
        return $closure($extraParam);
    }
}

Now for my test, I mocked the first parameter SomeModel.

$subject = $this->getMock(SomeModel::class, [], [], '', false);
$subject->expects($this->any())->method('getSomeValue')->will($this->returnValue('1'));

$closure = ????; // WHAT GOES HERE
$obj = new Something();
$expected = 'Custom return';
$extraParam = 'not important';
$this->assertEquals($expected, $obj->aroundDoStuff($subject, $closure, $extraParam));