texts:
I've recently started learning about creating EAV models. It's been quite the ride so far. Although I feel I'm very close right now.

Currently I have created a "Vendor" EAV Model, but when I try to save the model it throws an SQL 1452 Error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento`.`dh_onsite_vendor_entity`, CONSTRAINT `FK_DH_ONSITE_VENDOR_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_), query was: INSERT INTO `dh_onsite_vendor_entity` (`entity_type_id`, `created_at`, `updated_at`) VALUES (?, '2017-01-17 21:40:04', '2017-01-17 21:40:04')

What I've found to be the problem is that Magento isn't automatically adding the correct values into entity_type_id and attribute_set_id.

Here is code that throws the error:

$test = Mage::getModel('onsite/vendor');
$test->setLabel('Hello World');

$test->save();

Here is code that doesn't throw the error:

$test = Mage::getModel('onsite/vendor');
$test->setLabel('Hello World');
$test->setAttributeSetId(9);
$test->setEntityId(10);

$test->save();

I realized this because I was able to create a record by setting this myself.

Please let me know if you need anymore information from me.


texts: How to add custom model data in cart programmatically in magento?

texts: i created custom model(e.g. 'Sample' model) and create one table(fields are like name,price,description) and their fields value store in form input type so i want to add their data in cart so how can i achieve this functionality ?


texts:
I am creating simple products and try to set some attribute values

$attributeSetId = $product->getDefaultAttributeSetId();
$product->setSku($sku); // Set your sku here
$product->setName($product_title); // Name of Product
$product->setAttributeSetId($attributeSetId); // Attribute set id
$product->setStatus(0); // Status on product enabled/ disabled 1/0, disabled by default

$product->setWeight(10); // weight of product

$product->setVisibility(4); // visibilty of product (catalog / search / catalog, search / Not visible individually)
$product->setTaxClassId(0); // Tax class id
$product->setTypeId('simple'); // type of product (simple/virtual/downloadable/configurable)
$product->setPrice($product_price); // price of product
$product->setStockData(
    array(
        'use_config_manage_stock' => 0,
        'manage_stock' => 1,
        'is_in_stock' => 1,
        'qty' => $qtyAvailable
    )
);
echo "Qty: ", $qtyAvailable, "\n";
foreach ($options_list as $current_option) {
    $attributeCode = $current_option["attribute_code"];
    $attributeValue = $current_option["option_code"];
    if ($attributeCode == 'color') {
            $product->setColor($attributeValue);
            echo "Color ";
    } else {
            $product->setData($attributeCode, $attributeValue);
    }
    echo "Setting attribute: ", $attributeCode, " ", $attributeValue."\n";
}
$product->save();

I have created 2 product attributes in the backend, color and shipsfrom.
I have added these attributes to the default set.

As you can see in the code I am trying different methods to add the attribute value to my product, setColor or setData.

The values in my options array are as follow:

attributeCode    attributeValue
color            White
shipsfrom        Spain

However neither color nor shipsfrom got any value assigned to them after product creation, while all other  standard attributes do get values assigned properly.

Am I using the wrong methods to update these attributes ?


texts: I have no idea related magento2 development process, please give the real development process for magento Application.


texts: How to add/update custom layout update on magento 2.3.4

texts:
Anybody have idea how to add/update "Custom Layout Update" field of category or product in magento version 2.3.4

According to magento standard document,"You can no longer specify an entity-specific layout update with text but instead must create a physical file that contains the layout updates and select it for use."

But there is no option to select physical file on categories or product edit level.

After upgrade version from 2.3.3 to 2.3.4, which categories have "Custom Layout Update" exist now those are with drop down and "Use existing" selected but which does not have custom layout update those are with "No update" on drop down.

so really confused that how we could add new or update existing?

Please help!


texts: How to Change the Default Item Count of Lists (Grids) in the Backend?

texts:
All the admin grids show - by default - 20 items.

How can this default by increased?


texts: Unique constraint violation found when creating order programmatically

texts:
I've been trying to create an order programatically in Magento 2.3 and the order is created but my code dies and I get the error : "Unique constraint violation found".

What do I need to add or change? Here is my code (I´ll remove objectmanager when it´s working):

    $store=$this->_storeManager->getStore();

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $cartManagementInterface = $objectManager->get('\Magento\Quote\Api\CartManagementInterface');
    $cartRepositoryInterface = $objectManager->get('\Magento\Quote\Api\CartRepositoryInterface');

    $cart_id = $cartManagementInterface->createEmptyCart();
    $quote = $cartRepositoryInterface->get($cart_id);

    //$quote=$this->quote->create(); //Create object of quote
    $quote->setStore($store); //set store for which you create quote
    // if you have allready buyer id then you can load customer directly
    $customer= $this->customerRepository->get($orderData["email"]);
    $quote->setCurrency();
    $quote->assignCustomer($customer); //Assign quote to customer

    //add items in quote
    $this->productHelper->setSkipSaleableCheck(true);
    foreach($orderData['items'] as $item)
    {
        $product=$this->_product->create()->load($item['product_id']);
        $quote->addProduct(
            $product,
            intval($item['qty'])
        );
    }
    $this->productHelper->setSkipSaleableCheck(false);

    //Set Address to quote
    $quote->getBillingAddress()->addData($orderData['shipping_address']);

    $quote->getShippingAddress()->addData($orderData['shipping_address']);

    $this->shippingRate
        ->setCode('freeshipping_freeshipping')
        ->getPrice(1);

    // Collect Rates and Set Shipping & Payment Method

    $shippingAddress=$quote->getShippingAddress();
    $shippingAddress->setCollectShippingRates(true)
        ->collectShippingRates()
        ->setShippingMethod('freeshipping_freeshipping'); //shipping method

    $quote->getShippingAddress()->addShippingRate($this->shippingRate);

    $quote->setPaymentMethod('cashondelivery'); //payment method
    $quote->setInventoryProcessed(true); //not effetc inventory
    $quote->save(); //Now Save quote and your quote is ready

    // Set Sales Order Payment
    $quote->getPayment()->importData(['method' => 'cashondelivery']);

    // Collect Totals & Save Quote
    $quote->collectTotals()->save();

    // Create Order From Quote

    $cartManagementInterface = $objectManager->get('\Magento\Quote\Api\CartManagementInterface');

    $order = $cartManagementInterface->placeOrder($quote->getId());

    //give a result back
    if($order->getEntityId()){
        $result['order_id'] = $order->getEntityId();
    }else{
        $result=['error'=>1,'msg'=>'Your custom message'];
    }

    return $result;


texts: multiselect column is not saving in the database

texts:
I have created my own module in magento with admin grids.In that admin grid form i have added multiselect options column like,

$fieldset->addField('category_id', 'multiselect', array(
        'name'     => 'category_id[]',
        'label'    => Mage::helper('bcpl_blog')->__('Category Name'),
        'title'    => Mage::helper('bcpl_blog')->__('Category Name'),
        'required' => true,
        'values'    => Mage::getModel("bcpl_blog/category")->getCollection()->toArrayCustom()
    ));

my collection looks like,

public function toArrayCustom(){
    $data = $this->getData();
    $items = array();
    if(count($data)){
        foreach($data as $item){
             $items[$item['category_id']] = array('label'=>$item['category_name'],'value'=>$item['category_id']);

        }
    }

    return $items;
}

now 'category_id' is not saving for multiselect.


texts: Logo and favicon not uploaded from backend after upgrade PHP version 7.1 and Magento 2.2.1

texts:
I have upgraded the PHP version 7.1 and Magento 2.2.1. When I uploaded the logo and favicon from backend I get the error message "Invalid scope or scope id
"


texts: How to count disabled products with no images from querey in magento2?

texts:
Hi i have many products in my store with no pictures , some of them are enable and some of them are disabled , i wants to count those products only via sql query which are disabled as well as no thumbnail or picture stored.

Please  help !


texts: Magento 2.3 - How to modify language pack

texts:
I have a language pack that I cloned from git into my project.
The path to the module is: app/i18n/magenerds/de_DE
It's registration.phpsays

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'magenerds_de_de',
    __DIR__
);

Now I need to add a translation that doesn't seem to be included in that language pack:The title of the category navigation on the left in the category view is still in english, it says "Categories"
Here's what I did:

Created a new folder: app/i18n/myproject/de_DE
added a registration.php
added a language.xml
added a de_DE.csv
bin/magento setup:upgrade
bin/magento cache:flush

Magento is set to default mode so no need to deploy static content, correct?
I flushed everything in the cache section in the backend though to be sure.

This is what's in the files:

  language.xml

<?xml version="1.0"?>
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
  de_DE
  <vendor>myproject</vendor>
  <package>de_de</package>
  <sort_order>10</sort_order>
  <use vendor="magenerds" package="de_de" />
</language>

  registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
'myproject_de_de',
__DIR__
);

  de_DE.csv

"Categories","Kategorien"

Unfortunately it doesn't work.
What did I miss?


texts: Remove “text/x-generic header.phtml PHP script text ”

texts:
I removed the Welcome Message bar by commenting out code in file: app/design/frontend/package/default/template/page/html/header.phtml

Instead of Welcome Message bar I now get writing: text/x-generic header.phtml PHP script text
How I do I get rid of this. I've tried altering empty.phtml in /app/design/frontend/theme/default/template /page/empty.phtml but does not work. All help will be greatly appreciated.


texts: Programmatically change order status if transaction is successful

texts:
I am using Website Payments Pro Payflow Edition for my store and wanted to know if there is a way to automatically change the order status from Processing to Ready to ship if the transaction it successful as currently our admin is having to do this manually.

I was thinking to use an Observer to change the status but so far I can only find the event to invoice:

<?php

class MyCompany_OrdersObserver_Model_Observer {

    public $order;//the order...

    function afterSalesOrderSaveCommitAfter(&$event) {
        return $this->__process($event);
    }

    protected function __process($event) {
        $this->order = $event->getEvent()->getOrder();
        if (!$this->order->getId()) {
            //order is not saved in the database
            return $this;
        }
        else {

            $this->createInvoice();
        }
    }

    protected function createInvoice() {
        $orderState = $this->order->getState();
        if ($orderState === Mage_Sales_Model_Order::STATE_NEW) { // Check for state new.
            if ($this->order->canInvoice()) {
                $this->order->getPayment()->setSkipTransactionCreation(false);
                $invoice = $this->order->prepareInvoice();
                $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
                $invoice->register();
                Mage::getModel('core/resource_transaction')
                   ->addObject($invoice)
                   ->addObject($this->order)
                   ->save();
            }
            else {
                //we can not invoice it so the process is normal.
            }
        }
    }
}

Is there another event I could use to achieve this? Or is it a configuration issue?

Any advice would be greatly appreciated


texts: Hellowired Theme checkout process not working on Magento CE 1.8

texts:
Magento Hellowired Theme checkout process not working on CE 1.8 but it works fine in CE 1.7

I'm having an issue with checkout process as on step 3 Shipping Method .

And also "Your Checkout Process" on the right bar doesn't get message.


texts: How to call the "Sort By" feature in Left Column in Category page

texts:
I have to show the "Sort By" feature in Left Column along with the other Attributes. How to call the Sort by in the left section specifically in layered navigation section. I want something like this website http://www.glasses.com/mens
Any hint can be appreciated.


texts: How to export openERP invoices to Magento?

texts: I successfully connected openERP to Magento. Now I am getting all the orders in openERP as sales orders, which we added in Mageno. Now I created invoices for that orders but how to export that invoices to Magento?


texts:
I have a custom folder with styles to different elements, for example buttons.
Custom_theme / web / css / source / uikit / elements / _buttons.less
It is loaded by an index.css. That works.
Also, I have a custom theme (inherits from blank theme) in which I need a cleaner style configuration.
For example, I have an overriding module, Checkout_module and I want to change button styles. If I want to change color, or background ... I have to overwrite a specific rule because default magento styles has a big specifity rule.
My custom style in _buttons.less:
.custom-button {
    color: red;
    background: gray;
}

Default theme style in checkout (its an example):
.checkout> .class1> .class2> .class3a .class3b default {
    // default styles with other color and background
}

Where do I want to go with this?
If I put .custom-button in any button tag, by specifity, this button will load default styles first.
I want to clear those styles and use only my own custom styles.


texts: How can I protect my Magento site from spam?

texts: I#'m using 1.9.2.0 and the rwd theme, however since our site went online I'm getting many spam Mails via contact form. I already downloaded the Re-Captcha extension but it doesn't fit in our theme. How can I protect my site from spam?


texts: Magento2 install sample data after - I get invalid credentials

texts:
I run composer update from root and I get:

Loading composer repositories with package information
    Authentication required (repo.magento.com):

I enter my credentials that I use to login here:
https://www.magentocommerce.com/magento-connect/customer/account/

and the same ones that I used to install magento in the first place, but I get this error:

 [Composer\Downloader\TransportException]
  Invalid credentials for 'https://repo.magento.com/packages.json', aborting.

What sort of credentials do I need to input? Thanks!


texts: Error Segmentation fault (core dumped) in Magento 2

texts:
I have installed Magento 2 in my Windows Local Machine using WAMP 3.0.4. I tried making a simple "Hello World" module. But, when I tried to run the module, I get the following error:

Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Censere_HelloWorld schema: current version - none, required version - 1.0.0
Censere_HelloWorld data: current version - none, required version - 1.0.0

But when I tried to run the command php bin/magento setup:upgrade in Cygwin, it throws me the error:
Segmentation fault (core dumped)

What could I do?
Thanks.


texts: Mageto1.9 : custom module saveAction() not working for new form

texts:
I have created a custom module, It was working before, but now when I'm trying to create new form it is not generating id even previously creating form updating successfully.

I checked in saveAction() function all fields values are proper and after $model->save() I checked all fields have values except id.

Please guide me how to solve this issue?

public function saveAction()
    {
        if ($data = $this->getRequest()->getPost())
        {
            /* for multiselect fields */
            Mage::log(print_r($data, 1), null, 'test.log');
            foreach ($data as $key => $value)
            {
                if (is_array($value))
                {
                    $data[$key] = implode(',',$this->getRequest()->getParam($key));
                }
            }

            $model = Mage::getModel('custom/module');
            $model->setData($data)
                ->setId($this->getRequest()->getParam('id'));

            try
            {
                $model->save();

                Mage::log(print_r($model->getdata(), 1), null, 'test.log');

                Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('custom')->__('Saved successfully.'));
                Mage::getSingleton('adminhtml/session')->setFormData(false);
                if ($this->getRequest()->getParam('back'))
                {
                    $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id'),'id' => $model->getId()));
                    return;
                }
                $this->_redirect('*/*/');
                return;
            }
            catch (Exception $e)
            {
                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                Mage::getSingleton('adminhtml/session')->setFormData($data);
                $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id'),'id' => $this->getRequest()->getParam('id')));
                return;
            }
        }
        Mage::getSingleton('adminhtml/session')->addError(Mage::helper('custom')->__('Unable to find block to save'));
        $this->_redirect('*/*/');
    }

I'm getting success message, but no id generated from the $model.


texts:
I've met with a case. A customer placed an order with products that should be on a sale, but they are bought without a discount. As it turned out, he placed the order when catalogrule_apply_all cronjob was applying catalog price rules.
It looks like a normal behaviour of Magento, but it leads to a bad user experience.

I would like to avoid the same issues in the future, but I'm not sure in which way I will be able to do it.


texts: Get All attributes of a product By ID magento 2.3 REST API

texts:
I am trying to create a custom API to get all attributes of a product.

{{host}}/products/attribute-sets/17/attributes
{{host}}/products/attributes?searchCriteria[filter_groups][0][filters][0][field]=attribute_id&searchCriteria[filter_groups][0][filters][0][value]=97, 75, 125, 87, 128, 78, 104, 101, 135, 73, 76, 88, 84, 79, 106, 102, 74, 89, 85, 80, 117, 100, 122, 157, 86, 81, 116, 77, 90, 92, 91, 121, 96, 119, 134, 120, 98, 115, 124, 158, 103, 159, 129, 160, 82, 161, 107, 123, 108, 162, 109, 99, 110, 105, 111, 94, 112, 95, 113, 163, 164, 114, 167, 165, 130, 131, 132, 133, 136&searchCriteria[filter_groups][0][filters][0][condition_type]=in&searchCriteria[filter_groups][1][filters][0][field]=is_visible_on_front&searchCriteria[filter_groups][1][filters][0][value]=1&searchCriteria[filter_groups][1][filters][0][condition_type]=eq

What I want is a combined result of above mentioned API.When I call

{{host}}/products/attribute-sets/17/attributes

API, It doesn't provide all attributes value (like is_visible_on_front..).To get a detailed attribute I have to call the next API with all attribute id returned from the first API. So I wanted to know if there is a built-in API to achieve the result. Or how to create a custom API for the result. Please somebody help.


texts: Magento EE 1.14.4.4 Upgrade - Console error in Checkout Page. "decorateTable is not defined"

texts:
We have upgraded our Magento EE to  1.14.4.4.

After upgrade, the Cart page and Checkout Page review step throws below-console error in IE.

  decorateTable is undefined


texts: How do I add to a customer attribute a value?

texts:
I have a custom customer attribute and I want to assign a value to that attribute for a specific customer.
This is how I get my customer:

$customer_email = "test@test.com";
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId(1);
$customer->loadByEmail($customer_email);

The custom customer attribute id is : cat_id.

How do I add a value to the attribute for a specific customer using its email address? THx


texts: Error while listing products of a particular category

texts:
This is my block

 <?php
namespace Xlabs\Ajaxscroll\Block\Product;

class Ajaxscroll extends \Magento\CatalogWidget\Block\Product\ProductsList
{
    protected $productCollectionFactory;
    protected $_categoryFactory;

    public function __construct(
            \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
            \Magento\Catalog\Model\CategoryFactory $categoryFactory,
            array $data = []
        ){
        $this->productCollectionFactory = $productCollectionFactory;
        $this->_categoryFactory = $categoryFactory;

        }

    public function getProductList(){

        $categoryId = 12;
        $category = $this->_categoryFactory->create()->load($categoryId);
        $collection = $this->productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addCategoryFilter($category);
        $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);

    return $collection;
    }

}

  Blockquote

and i am getting the error

Fatal error: Uncaught Error: Call to a member function dispatch() on null in /var/www/html/sample221/vendor/magento/framework/View/Element/AbstractBlock.php:652 Stack trace: #0 /var/www/html/sample221/generated/code/Techievolve/Ajaxscroll/Block/Product/Ajaxscroll/Interceptor.php(830): Magento\Framework\View\Element\AbstractBlock->toHtml() #1 /var/www/html/sample221/vendor/magento/framework/View/Layout.php(558): Techievolve\Ajaxscroll\Block\Product\Ajaxscroll\Interceptor->toHtml() #2 /var/www/html/sample221/vendor/magento/framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('Ajaxscroll_bloc...') #3 /var/www/html/sample221/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('Ajaxscroll_bloc...') #4 /var/www/html/sample221/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('Ajaxscroll_bloc...') #5 /var/www/html/sample221/generated/code/Magento/Framework/View/Layout/Intercep in /var/www/html/sample221/vendor/magento/framework/View/Element/AbstractBlock.php on line 652


texts: Magento2 : Credit card validations on a custom form not working

texts:
I am trying to add Credit card validations on Custom payment form

 <form id="testForm" data-mage-init='{"validation":{}}'>
            First name:

            <input type="text" name="firstname" class="required-entry" >

           credit card:

            <input type="text" name="creditcard" class="required-entry validate-cc-number">
            CCV:

            <input type="text" name="cvv" class="required-entry validate-cc-cvn">

            <input type="submit" value="Submit">
        </form>

I have also added dependency for it

require([
    'jquery',
    'jquery.bootstrap',
    'payment',
    'mage/validation'
], function ($, bootstrap, payment, validation) { }

validate-cc-number  is not working as expected when input is empty is gives error

  Please enter a valid credit card number

but even if i input 'TestCard' as input it validates and shows no error , for cvv it does not even throws an error message

What am i missing ?


texts: Magento2: How to output the contents of an entire JS file into a phtml file?

texts:
I defined a function in a block class as below to return the contents of an entire custom JS file, the path of which is stored in $absolute_custom_js_file_path . What is the right PHP function to be used inside the return statement so that my phtml file would get all the JS file contents? Thanks for the help.

    public function getAllPagesJSContent() {
    // Code to get the absolute path to the media directory.
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $fileSystem = $objectManager->create('\Magento\Framework\Filesystem');
    $mediaPath = $fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath();

    // Code to get the absolute path to the custom JS file.
    $absolute_custom_js_file_path = $mediaPath . 'pmm-custom/allpages.js';
    return __('What PHP function to use to read and return the contents of the JS file)');
}

Here is the phtml:

<?php
echo $block->getAllPagesJSContent();
?>


texts:
I having an issue with the categories changing case between the backend and the frontend. I have a category 'ATV' which should be uppercase and is in the backend as you can see in the image, but when it is displayed as a nav element in the front end it is only capitalized. Is this just how Magento displays categories or does it have something to do with the theme? I could handle it with some css but was wondering if there was a way to make it honor what is in the backend.

Thanks, Daniel


texts: Magento SortBy options not available in other category

texts:
I am facing issue with sort-by option.I have two categories in that one of category(Products list page) should not display some attributes in sort-by option.
Like this:

In First category: Array ( [position] => Position [name] => Name )
In Second category: Array ( [position] => Position [name] => Name [price] => Price [sponsored] => Sponsored [paidmembers] => Paid

Two attributes is missed in First Category


texts: Magento 2 Knockout Js Customer Name update issue after changing customer name

texts:
I am having strange issue. In header, along with Welcome message i am showing Customer full name.

For that i am using knockout.js concept.

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

        <button type="button"
                class="action switch"
                tabindex="-1"
                data-action="customer-menu-toggle">
            <?php echo $block->escapeHtml(__('Change')) ?>
        </button>

using above code displaying customer full name in header when customer logged in.  For Ex:   welcome Peter Parkar

When we change the customer name from account information section like below screenshot  it doesn't update the customer name in header.  If we logut and re-login then only it shows customer's updated name in header.

If we update the customer name it doesn't immediately reflect customer name in header.

What could be the issue?  How can i resolve it?  is there any way knockout.js can check for the updated details?

any help would be appreciated.


texts: How to restrict customer only to add products in cart Magento 2?

texts:
I need to integrate a functionality where when a user clicks add to cart it should check whether he is a logged in customer or not. If he is a logged in customer the product should be added in cart. Else it should redirect to Login page after logging in the products to be added automatically.
If anyone has any idea pls share.


texts: How do I get text value for span that is populated with KO?

texts:
inside a js file I need to get the value for

 $('.modal-custom.opc-sidebar.opc-summary-wrapper.custom-slide span.cart-price span.price').text()

The probles is that span.cart-price span.price is populated using knockout, and $('.modal-custom.opc-sidebar.opc-summary-wrapper.custom-slide span.cart-price span.price').text() returns empty value.

$('.modal-custom.opc-sidebar.opc-summary-wrapper.custom-slide').text()
returns only the title of the cart, the list of products and total cost is added with KO.

 750,10&nbsp;LEI

this is the content of the file

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

    return function (targetFunction) {
        targetFunction.getObservableFields = function () {
            var self = this,
                observableFields = [];

            $.each(self.getRules(), function (carrier, fields) {
                $.each(fields, function (field) {
                    if (observableFields.indexOf(field) === -1) {
                        observableFields.push(field);
                    }
                });
            });

            console.log($('span.price').text());

            observableFields.push('city_id'); // Load shipping method on City_id changed
            observableFields.push('city'); // Load shipping method on City changed

            return observableFields;
        };

        return targetFunction;
    };
});


texts:
We use the Sales orders report to know how many bucks we earn. For this reason we update the statistic every day by a cron job. But the report has wrong values. Nothing it's equal to the values that we get by adding manually or adding by SQL query over the sales_flat_order table (only for status='complete').

The view Sales orders show all orders correctly.

I can't understand why the report supply wrong data. What can I do to fix this problem?


texts: configurable price issue in quickview and list page magento2

texts:
I'm having an issue with pricebox.js/configurable.js and configurable products. They are used in quickview and on individual product pages.

same Issue I can see in this platform in this link
Pricebox.js Issue Magento 2

I have updated my configurable.js for this line:

priceBoxOptions = $(this.options.priceHolderSelector).priceBox('option').priceConfig || null;

as

priceBoxOptions = $(this.options.priceHolderSelector).priceBox().priceBox('option', 'openOnFocus', true).priceConfig || null;

This has resolved option load issue. but pricing is not showing correct now. Also on change of quick view super attributes options, product list page prices updating as same price.

Can someone help?


texts: js merge carousels sliders are breaking when js merge

texts:
After js merge carousels sliders are breaking in the site, followed no-conflict and other solutions, also in the console this is showing

  Uncaught TypeError: jQueryowlCarousel is not a function

can you help me on this issue


texts: How can we add/register our own custom view mode in addition to default grid and list mode?

texts:
I am new to magento and using 2.4.2. I have some prior experience in working with TYPO3 CMS. Ok. Now I want to add custom table mode to the defaults (Stores -> Catalog -> Storefront -> List Mode) which needs to list the category in the table view mode.

I can understand extending something in the core is not a easy job for a beginner. I have not found any great resources regarding this topic. So kindly share some advice on what needs to be done to fulfil my requirements and provide me some references on this topic in general.


texts: Upgrade from Open Source to Commerce Error

texts:
I am upgrading Magento 2.3.1 Community Edition to Magento 2.3.1 Enterprise Edition.
All these prerequisites are done ✅
By Upgrade from the Magento Admin it do not give option of Eneterprise Edition in the list, it is only CE.
By following Command line Upgrade, it stucks when I execute:

composer require magento/product-enterprise-edition=2.3.2 --no-update

and prompts this error message:

  [InvalidArgumentException]
  Could not find a matching version of package
  magento/product-enterprise-edition. Check the package spelling, your
  version con     straint and that the package is available in a
  stability which matches your minimum-stability (stable).

The issue is not getting solved by many developers like me. Need your kind attention !


texts: Magento 2 Rest api created category not displaying backend

texts:
I created Product category using rest Api. It doesn't give any error and it give category id and others its sign to it created successfully but I checked in backend
it does't appear .I try to re indexing but same result.
here is my code  to used create category

<?php

// Authentication rest API magento2, get access token

$ch = curl_init();
$data = array(
    "username" => $username,
    "password" => $password
);
$data_string = json_encode($data);
$ch = curl_init($token_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_string)
));
$token = curl_exec($ch);
$adminToken = json_decode($token);

// ////////////**************************************************//////////////

$newCategoryJson = '{
    "category": {
        "name": "test",
        "level": 1,
        "path": "1",
        "isActive": true
    },
    "saveOptions": true
}';
$setHaders = array(
    'Content-Type:application/json',
    'Authorization:Bearer ' . $adminToken
);
$ch = curl_init("http://demo.magento.com/magento2/project-community-edition/index.php/rest/V1/categories");

// curl_setopt($ch, CURLOPT_HTTPHEADER, $setHaders);

$curlOptions = array(
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => $newCategoryJson,
    CURLOPT_HTTPHEADER => $setHaders
);
curl_setopt_array($ch, $curlOptions);
$response = curl_exec($ch);
echo var_dump($response);

Here is MY response json response

{
    "id": 42,
    "parent_id": 1,
    "name": "test",
    "is_active": true,
    "position": 2,
    "level": 1,
    "children": "2,3,9,11,20,37,38",
    "created_at": "2016-09-23 02:51:47",
    "updated_at": "2016-09-23 02:51:47",
    "path": "1",
    "available_sort_by": [],
    "include_in_menu": true,
    "custom_attributes": [{
        "attribute_code": "is_anchor",
        "value": "1"
    }, {
        "attribute_code": "path",
        "value": "1"
    }, {
        "attribute_code": "children",
        "value": "2,3,9,11,20,37,38"
    }, {
        "attribute_code": "children_count",
        "value": "0"
    }, {
        "attribute_code": "url_key",
        "value": "test"
    }]
}

Nackend

Edit
I checked Database also It On Database also.


texts: Lack of taxes in product price and totals

texts:
I have products with tax classes - 8-taxable goods and 23-taxable goods. Price of product doesn't include taxes at all. Of course, I was trying to change many of these fields. But if my product has priced $49 it is the same including and excluding tax. In consequence, in checkout, I have no subtotals for taxes.

How it should work? What are the possible steps to add tax to products? Do I need tax rules? Or just adding tax class to product should make its prices different - is it available out of the box, without any deep configuration?

My current configuration of sales below:


texts: Magento2: Catalogsearch Result Page change to 1column doesnt work

texts:
Want my search results only in 1 column.
After updating my catalogsearch_result_index.xml with layout="1column" I got a blank site with a Error 500.

Clearing cache, deploy static files was done. (using Magento 2.2.6)

Any ideas?

File:

  /app/design/frontend/theme/Default/Magento_CatalogSearch/layout/catalogsearch_result_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <attribute name="class" value="page-products"/>
        <referenceContainer name="content">
            <block class="Magento\CatalogSearch\Block\Result" name="search.result" template="Magento_CatalogSearch::result.phtml">
                <block class="Magento\CatalogSearch\Block\SearchResult\ListProduct" name="search_result_list" template="Magento_Catalog::product/list.phtml">
                    <arguments>
                        <!-- If argument's position depends on image size changeable in VDE:
                        positions:list-secondary,grid-secondary,list-actions,grid-actions,list-primary,grid-primary
                    -->
                        <argument name="positioned" xsi:type="string">positions:list-secondary</argument>
                    </arguments>
                    <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
                        <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
                    </block>
                    <action method="setToolbarBlockName">
                        <argument name="name" xsi:type="string">product_list_toolbar</argument>
                    </action>
                    <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
                        <block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
                    </block>
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="catalogsearch.product.addto" as="addto">
                        <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                               name="catalogsearch.product.addto.compare" as="compare"
                               template="Magento_Catalog::product/list/addto/compare.phtml"/>
                    </block>
                </block>
                <action method="setListOrders"/>
                <action method="setListModes"/>
                <action method="setListCollection"/>
            </block>
            <block name="search.search_terms_log" template="Magento_CatalogSearch::search_terms_log.phtml">
                <arguments>
                    <argument name="search_terms_log" xsi:type="object">Magento\CatalogSearch\Block\SearchTermsLog</argument>
                </arguments>
            </block>
            <referenceBlock name="sidebar.additional" remove="true"/>
        </referenceContainer>
    </body>
</page>


texts: Add jQuery plugin waypoint.js, but file does not apear in static folder (Magento 2)

texts:
I am trying to add a jQuery Plugin waypoint.js to my theme. I did the following:

File: app/design/frontend/name/themename/requirejs_config.js

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

JS File is here: app/design/frontend/name/themename/web/js/waypoint.js

I call it in a phtml file:

require(['jquery','waypoint'],function($){

});

The Chrome debugging tool shows me an error now, can't find that waypoing.js in the static folder here:

  Uncaught SyntaxError: Unexpected identifier
  require.js:1895 GET
  pub/static/frontend/name/themename/de_CH/waypoint.js

The file waypoint.js does not exist in that folder. How to bring it there?


texts: Magento 2.2.5 : How to place a check on prouduct page on product attributes

texts:
How can we can place an if condition on proudct attibutes in a frontend .phtml file

In front end .phtml which is associated with our handle in custom module layout catalog_product_view , we get serialized_condition as

  {"type":"Vendor\Module\Model\Rule\Condition\Combine","attribute":null,"operator":null,"value":"1","is_value_processed":null,"aggregator":"all","conditions":[{"type":"Vendor\Module\Model\Rule\Condition\Product","attribute":"category_ids","operator":"==","value":"2","is_value_processed":false}]}

How to get all attibutes and  place an if condition on the attributes which matches our values in db table column name serialized_conditions  like , if either the Sku ,climate,collar etc matches with the current product-  do certain operation? Even if someone can provide directions about how it is done in the core files would be appreciated.


texts: Magento 2: How can I modify the product edit page depending on my custom product types

texts: Is it posible to hide/remove default fields and fieldsets from the product edit page for custom product types? For example weight, price, tax_class...


texts: Magento : How To Add Custom Form in New Shipment

texts:
I include new form in New Shipment. So I can get it up later in Observer.

What is best way to include in table?
I mean, should I include fields in sales_flat_shipment?
How can I get them later in an Observer?

Currently I imagine through ovserver:

$shipment = $observer->getEvent()->getShipment();
$order = $shipment->getOrder();
echo $order->getField();

Thank you very much in advance.


texts: Magento 2 : Filter Product Grid Using Category In Admin

texts:
Is there any way to filter products grid collection in the admin > Product > Catalog grid by category Magento 2.1+?

I would like to filter products that are within a filtered category.

There seems to be a few examples of how to add Category column to the Grid however, I have tried 3 separate examples, and none of them seem to work.


texts: How to override Customer Controller in local in magento with block

texts:
I need to use customer controller for creating registration page for in local..and the same time on that page i also want to give login page....

Means I want to completely override Customer module in vendor module in magento....local

I need to know that what setting should I do...in that for overriding complete module in

magento...

I need to create Vendor Register page different then customer page..and want to give login that  for vendor

I tried to use Cybage market place module...

magento-8/index.php/customer/account/create/

this is my url on that i m getting customer registration form...

magento-8/index.php/customer/account/vendor/

This is my url for vendor...

on this url... I just want to load customer form with functionality of customer

I tried to add action in accountController.php

in app/code/core/mage/customer/accountController.php

this controller I want to load that on vendor form

Customer  controller function  is ..
------------------------------

public function createAction() {
        if ($this->_getSession()->isLoggedIn()) {
            $this->_redirect('*/*');
            return;
        }

        $this->loadLayout();
        $this->_initLayoutMessages('customer/session');
        $this->renderLayout();
    }

 i want to use this like
--------------------------

public function vendorAction() {
        if ($this->_getSession()->isLoggedIn()) {
            $this->_redirect('*/*');
            return;
        }

        $this->loadLayout();
        $this->_initLayoutMessages('customer/session');
        $this->renderLayout();
    }

and my url will be..

magento-8/index.php/customer/account/vendor/


texts:
We currently have a Magento 2 store that uses MD5 Hash to connect to Authorize.

Authorize is phasing out the MD5 based hash we need to move to SHA-256 hash via Signature Key.

Did any of you have to go through this?
Can you shed some light on what needs to be done?
Thank you in advance.


texts:
Is it normal for urls to not be rewritten when using Layered Navigation to click thru categories?

For example: A category when clicking via the main top menu is:

http://www.mywebsite.com/clothing/accessories

But when clicking the same category via the Layered Navigation comes up as:

http://www.mywebsite.com/clothing?cat=10

I also notice that the Category Name does not change when using Layered Navigation. I have not noticed this until now so am not sure if this is normal behaviour.


texts:
My code:

<select class="validate-select" title="subjects" id="subjects1" name="subject" >
    <option value=""><?php echo $this->__("Please select Subject");?></option>
    <option value="english"><?php echo $this->__("English");?></option>
    <option value="maths"><?php echo $this->__("Maths");?></option>
    <option value="science"><?php echo $this->__("Science");?></option>

</select>
<select class="validate-select" title="subjects" id="subjects" name="subjects" >
    <option value=""><?php echo $this->__("--Please select Subject--");?></option>
    <option value="general paper"><?php echo $this->__("General Paper");?></option>
    <option value="biology"><?php echo $this->__("Biology");?></option>
    <option value="chemistry"><?php echo $this->__("Chemistry");?></option>
    <option value="physics"><?php echo $this->__("Physics");?></option>

</select>

Don't know why but i m not getting error message

like this message should be display please select option but i m not getting it how to display message


texts:
I want to iterate over all the total models in order to get the code & values.
I have $order object and the only way I can get all the totals is using $quote object as:

$order   = Mage::getModel('sales/order')->load($orderId);
$quoteId = $order->getQuoteId();
$quote   = Mage::getModel('sales/quote')->load($quoteId);
$totals  = $quote->getTotals();
foreach ($totals as $_total) {
   echo $_total->getCode() . ' => ' . $_total->getValue() . '<br />;
}

which works fine & outputs as:

subtotal => 19.9
shipping => 10.0000
reward => 0
giftcardaccount => 0
customerbalance => -25
grand_total => 4.9
giftwrapping =>

So my main query is how to get the totals from $order object itself without using $quote. Since $quote is earlier state of $order and I doubt there might be some issues using it for the calculation.

Let me know your thoughts.


texts: Magento 2 order update email message translation

texts:
Magento 2 order update email message text "order status" pending etc... translation doesn't work but other email message text content is translated correctly. I have translated every "order status" using admin panel Stores/Order status. How to fix this issue?

Email template

    {{template config_path="design/email/header_template"}}

{{trans "%name" name=$order.getCustomerName()}}

                {{trans
                    "Your order #%increment_id has been updated with a status of %order_status."

                    increment_id=$order.increment_id
                    order_status=$order.getStatusLabel()
                |raw}}

{{trans 'You can check the status of your order by logging into your account.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}

                {{trans 'If you have questions about your order, you can email us at %store_email' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at %store_phone' store_phone=$store_phone |raw}}{{/depend}}.
                {{depend store_hours}}
                    {{trans 'Our hours are %store_hours.' store_hours=$store_hours |raw}}
                {{/depend}}

            {{depend comment}}

                        {{var comment|escape|nl2br}}

            {{/depend}}

{{template config_path="design/email/footer_template"}}


texts:
We have prepared a script that convert the csv of  product that belong to our customer then we converted to the format that magento accepted (mapping of attributs with some condition on attributs to have configurable product) but when i import the csv i get errors :
Data validation failed. Please fix the following errors and upload the file again.

Following Error(s) has been occurred during importing process: Only the first 100 errors are shown. Download full report
1. Value for 'product_type' attribute contains incorrect value, see acceptable values on settings specified for Admin in row(s): 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101 Checked rows: 101, checked entities: 101, invalid rows: 100, total errors: 100

i found the errors that say : the "x", y , z attributes are invalid

and some times i get this error:

Duplicates found in column names: array ( 0 => 'sku', 1 => 'store_view_code', 2 => 'attribute_set_code', 3 => 'product_type', 4
=> 'categories', 5 => 'product_websites', 6 => 'name', 7 => 'description', 8 => 'short_description', 9 => 'weight', 10 => 'product_online', 11 => 'tax_class_name', 12 => 'visibility', 13 => 'price', 14 => 'special_price', 15 => 'special_price_from_date', 16 => 'special_price_to_date', 17 => 'url_key', 18 => 'meta_title', 19 => 'meta_keywords', 20 => 'meta_description', 21 => 'base_image', 22 => 'base_image_label', 23 => 'small_image', 24 => 'small_image_label', 25
=> 'thumbnail_image', 26 => 'thumbnail_image_label', 27 => 'swatch_image', 28 => 'swatch_image_label', 29 => 'created_at', 30 => 'updated_at', 31 => 'new_from_date', 32 => 'new_to_date', 33 => 'display_product_options_in', 34 => 'map_price', 35 => 'msrp_price', 36 => 'map_enabled', 37 => 'gift_message_available', 38 => 'custom_design', 39 => 'custom_design_from', 40 => 'custom_design_to', 41 => 'custom_layout_update', 42 => 'page_layout', 43 => 'product_options_container', 44 => 'msrp_display_actual_price_type', 45 => 'country_of_manufacture', 46 => 'additional_attributes', 47 => 'qty', 48 => 'out_of_stock_qty', 49 => 'use_config_min_qty', 50 => 'is_qty_decimal', 51 => 'allow_backorders', 52 => 'use_config_backorders', 53 => 'min_cart_qty', 54 => 'use_config_min_sale_qty', 55 => 'max_cart_qty', 56 => 'use_config_max_sale_qty', 57 => 'is_in_stock', 58 => 'notify_on_stock_below', 59 => 'use_config_notify_stock_qty', 60 => 'manage_stock', 61 => 'use_config_manage_stock', 62 => 'use_config_qty_increments', 63 => 'qty_increments', 64 => 'use_config_enable_qty_inc', 65 => 'enable_qty_increments', 66 => 'is_decimal_divided', 67 => 'website_id', 68 => 'related_skus', 69 => 'related_position', 70 => 'crosssell_skus', 71 => 'crosssell_position', 72 => 'upsell_skus', 73 => 'upsell_position', 74
=> 'additional_images', 75 => 'additional_image_labels', 76 => 'hide_from_product_page', 77 => 'bundle_price_type', 78 => 'bundle_sku_type', 79 => 'bundle_price_view', 80 => 'bundle_weight_type', 81 => 'bundle_values', 82 => 'bundle_shipment_type', 83 => 'configurable_variations', 84 => 'configurable_variation_labels', 85 => 'associated_skus', 86 => '', 87
=> '', )


texts: Magento2: Adding custom attribute to category doesn't show store specific value

texts:
I have created a custom category attribute using the custom code from here, attribute created successfully and able to save the value.

But I want to save store specific value in this custom attribute, So can save different value for English store view and Arabic store view.

I also try another way to create the custom category attribute, but no one saves store specific value.

I also found this issue on GitHub and try the given solution but not one is work for me.


texts: How can I capture save/update/delete events of custom extension?

texts:
I have one custom extension installed, and I want to capture its save/update/delete action events and I am not sure how can I capture those events. Please help.

I have successfully able to capture those events for core modules like product and categories but not sure how can I perform the same for the custom extension.

I have tried adding eventPrefix = 'aw_blog' on AW_Blog_Model_Blog class and than in my config.xml file

 <aw_blog_prepare_save>
            <observers>
                <post>
                    <type>singleton</type>
                    <class>post/observer</class>
                    <method>blogBeforeSave</method>
                </post>
            </observers>
        </aw_blog_prepare_save>

but still its not working for me. Please help.
Thanks


texts:
I have a CSV on the FTP server that is generated by our EPOS system. I'd like to use this CSV file to update automatically (every day) the quantities available for the products in my store.

The issue is the column headers in the CSV do not match Magento field exactly. For example, 'SKU' is defined in the CSV as 'Product-Code'.

Can anyone suggest/recommend a solution?


texts: Admin session time out issue in Magento 1.9

texts:
Admin Config settings:
System => Configuration =>Web => Session Cookie Management => set Cookie Lifetime 259200.
And

  Go to =>  System => Configuration => Admin => Security => set
  Session Lifetime = 259200 (seconds)

Clean the magento cache.

And made changes to php.ini:

session.cookie_lifetime 259200

session.gc_maxlifetime 259200

after all these things admin logged out inactivity of 15 mins.


texts: Magento 2 REST API search in Product Media

texts:
I try to find all media IDs of one product with the position number 1 in

HOST/rest/all/V1/products/SKU/media

Everthing I can read tells me to use this:

GET
HOST/rest/V1/products/SKU/media?searchCriteria[filter_groups][0][filters][0][field]=position&searchCriteria[filter_groups][0][filters][0][value]=1

But whatever I do the result is the full list of the SKU which has 5 Pictures.


texts: Magento 2: How to disable module programmatically on mode change to production?

texts: I've created a custom module for developer mode only. So, I want to create functionality that disables module automatically when mode change from developer to production.


texts: Some product display default placeholder instead of image

texts:
I have a problem with some product image,  instead of them magento display placeholder.
I already execute image:resize but it didn't help.


texts: Magento 2.0 weird screen when adding a product

texts: We started a shop in Magento 2.0 but when adding a product we are getting a strange screen.  What is going wrong ?


texts: how to add Users mobile number to Magento report filter

texts:
I have followed inchoo post  to create the custom report for Magento 1.9 it works perfectly.

I want to add Users mobile number to the filter list.

Anybody can help?


texts: Changing tax rate (country), keeping the total price

texts:
We have the following situation:

Product should be sold at 19 EUR (that is the price - including tax - in the catalog)
When selling to Germany, the tax rate is 19%
When selling to Austria the tax rate is 20%

In each cases the product should be sold at 20 EUR total

Current situation: When changing the billing address to Austria, the products becomes 19,16 EUR

So of course the sellers margin changes in case of a different tax.
(It's pretty similar to Fast Food chains in Germany selling at the same price but 19% / 7% tax depending if you take-away)
Did anybody do this already and want to share his solution / approach?


texts:
I have knowledge for some language and CMS like that (wordpress),HTML,CSS, and little more knowledge for php.

so can you tell me. is that knowledge for proper working on magento or not??


texts: Magento is not adding the tax rate correctly

texts:
I'm trying to setup the tax rates for a client but for some reason the calculation is wrong.

New Zealand's tax rate is 15%. I only want to tax the sub total and show that. Shouldn't it be 23*0.15 = $3.45?

Current settings in Configuration -> Tax

Tax Class

Tax Class for Shipping - Taxable Goods

Calculation Settings

Tax Calculation Method Based On - total
Tax Calculation Based On - shipping Address
Catalog Prices - Including Tax
Shipping Prices - Including Tax
Apply Customer Tax - Before Discount
Apply Discount On Prices - Excluding tax
Apply Tax On - Custom Price if Available

Price Display Settings

Display Product Prices In Catalog - Including Tax
Display Shipping Prices - Including Tax

Shopping Cart Display Settings

Display Prices - Including Tax
Display Subtotal - Including Tax
Display Shipping Amount - Including Tax

Orders, Invoices, Credit Memos Display Settings

Display Prices - Including Tax
Display Subtotal - Including Tax
Display Shipping Amount - Including Tax


texts: How to remove default botstrap css applies on my custom theme?

texts: I created my own theme which depends on Luma theme. But I have an issue to applies some CSS such _reboot.scss , _grid.scss so how I can remove this?


texts: Why Magento has name Magento but Not color is Magento?

texts:
Name always has history. what is the history of magento naming.

why Magento name used but color not used magento?


texts:
I'm using ajax wishlist to add product in wishlist everything work fine but i can't update the wishlist count in header using ajax here is the php script that i called using ajax to get the current quantity in wishlist

       <?php
require_once('app/Mage.php');
umask(0);
Mage::app('default');
Mage::getSingleton('core/session', array('name'=>'frontend'));
$session = Mage::getSingleton('customer/session');
if ($session->isLoggedIn()) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
 $wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer, true);

echo $wishlist->getItemsCount();
}

but this give me a 500 internal server error in console


texts: Insert image at the side of payment label on checkout

texts:
How could I insert an image at the side of the payment method on checkout.

In example, at the side of credit cards payment method I want to display the Visa and Master Cards logo.


texts: How to override Email Header and Footer through module in Magento 2

texts:
I want to override magento email template file.

app/design/frontend/Vendor/themename/Magento_Email/email/header.html
app/design/frontend/Vendor/themename/Magento_Email/email/footer.html


texts: Custom AJAX discount-form not processing coupons

texts:
Running Magento 1.9.0.1 CE

I've created an AJAX version of the discount-form used in Magento to process coupons in Magento with the help of this tutorial: http://www.lelandcope.com/2012/04/how-to-create-an-ajax-coupon-discount-code-box-in-magento/

Basically, I left the previous discount form in place (verifying that there were no conflicts) so that I could verify my coupons quickly in case my AJAX form didn't work.

The gist is, my AJAX form is rejecting EVERY coupon. Here is the code summary.

AJAX Form HTML:

  DISCOUNT CODE

Enter your coupon code if you  have one

  <form id="discountcode-form" action="<?= $this->getUrl('checkout/cart/couponPost') ?>" name="discountcode-form" method="post">

<input type="text" name="coupon_code" value="SUBMIT YOUR CODE" />

    <input type="submit" class="btn-apply" value="APPLY"/>
  </form>

AJAX Form jQuery (in no-conflict mode):

And finally, the piece of the puzzle I believe to be responsible for the issue - CartController.php:

<?php

  require_once 'Mage/Checkout/controllers/CartController.php';

  class MyModules_CouponProcessor_CartController extends Mage_Checkout_CartController
  {
    function couponPostAction()
    {
      // if not ajax have parent deal with result

      if(!isset($_POST['ajax']))
      {
        parent::couponPostAction();
        return;
      }

      $msg = '';

      $couponCode = (string) $this->getRequest()->getParam('coupon_code');
          if ($this->getRequest()->getParam('remove') == 1) {
              $couponCode = '';
          }
          $oldCouponCode = $this->_getQuote()->getCouponCode();

          if (!strlen($couponCode) && !strlen($oldCouponCode)) {
              $this->_goBack();
              return;
          }

          try {
              $this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);
              $this->_getQuote()->setCouponCode(strlen($couponCode) ? $couponCode : '')
                  ->collectTotals()
                  ->save();

              if ($couponCode) {
                  if ($couponCode == $this->_getQuote()->getCouponCode()) {
                      $this->_getSession()->addSuccess(
                          $this->__('Coupon code "%s" was applied.', Mage::helper('core')->htmlEscape($couponCode))
                      );
                  }
                  else {
                     $msg = $this->__('Coupon code "%s" is not valid.', Mage::helper('core')->htmlEscape($couponCode));
                  }
              } else {
                  $this->_getSession()->addSuccess($this->__('Coupon code was canceled.'));
              }

          } catch (Mage_Core_Exception $e) {
              $msg = $e->getMessage();
          } catch (Exception $e) {
               $msg = $this->__('Cannot apply the coupon code.');
              Mage::logException($e);
          }

      echo $msg;
    }
  }

Am I doing something wrong in my CartController? The AJAX seems to work fine.


texts: i'm new to Magento 2, i am assigned to create a HTML search form which take input as a CustomerID and return the Customer info associated with that CustomerID, using oAuth and REST API.  I have no idea where I should begin, or which documents I should take, please give me an advice !


texts: Create Product programatically for guest resulting blank page

texts:
we have below code and its creating new Product once registered user click on button "create"

_getControlPanelHtml: function()
    {
        if (this.config.editorEnabled) {
            return '
' +
                '<button onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();" id="submit-editorApply-{{rand}}" >Create</button>' +

                '
';
        }
        return '';
    },

we are trying to apply if else conditions and adding below code for creating new product after guest click on "create" button and login to site. but it showing blank page


texts: Where does magento do the redirect to configured base_url?

texts:
I'm trying to log calls to my magento installation through the old domain. I cannot figure out where the redirect to the configured new domain takes place.

Any suggestions?


texts: How to Reload Magento2 Site after SSL Certificate Instalation

texts:
I discovered that our magento site SSL certificate expired before we were able to renew it causing the homepage to be defaced and leaving visitors with the option to have to manually bypass the SSL expiry warning on the homepage.

Now that that the certificate is renewed, the SSL authority issued a new certificate meaning that we have to remove the previously installed SSL certificate on the centos server and install the newly generated one.

After the removal and installation of the new certificate on the server, does magento automatically after redeploying and recompiling via SSH.??

Or which operations/commands are required for magento to recognise the newly installed SSL certificate??

Thanks

Samuelson


texts: New database table best practice: Magento DB or a new DB?

texts:
I've added a new "Installation" info tab on the product details page so we can add installation information for each product.

I don't want future Magento upgrades to destroy new tables I create so should we add a new table into the existing Magento db or create a separate db for custom tables?


texts:
I want to the parse the URL so I can get the Id from the URL , so I am using the parse_url() function but phpcs says The use of function parse_url() is discouraged ,so is there any alternative for this?

My goal is to get the ID from the string, I have string like http://some.com/demo/id/23/

Thanks,


texts:
I got this Notification message every time i open the admin.

Can anybody tell me in detail what to do ?

How to install these patches ?


texts:
I am facing issue in order update.

Presently when i create an order

We have Email order confirmation checked by default.

But similarly for order update/ create invoice/ create shipment

I need this to be checked by default as the orders may be updated/ shipment may be created from other source for my store.


texts: Custom Email Header and Footer Template in Magento 2

texts:
How can I change the email header template

{{template config_path="design/email/header_template"}}

or footer template

{{template config_path="design/email/footer_template"}}


texts: Magento2 getting 'Constr is not a constructor' error for custom theme

texts:
I am not sure what this error is and if it is affecting anthing, however this is coming into my console:

layout.js:64 Uncaught TypeError: Constr is not a constructor (layout.js line 64)


texts:
We have Magento EE 1.14. Admin was working fine till last two days its speed dropped dramatically. Frontend is not affected. Also no changes in code or server configuration. here is my attempt to fix the problem but nothing worked:

Log cleaning is properly configured
removed two unused extensions. but no improvement
tried to disable non-critical extensions to see if speed will improve but also not luck.
I can NOT use REDIS cache at this time. but configured new server which is using REDIS cache and move to it next month.
sometimes backend will gain speed for few minutes
I enabled profilers the source of the delay is mage ( screenshot attached ).

here are my question:

Is there anyway to know the exact reason for Mage delay ?
do I have other test i can use to identify the cause of delay ?

Thanks in advance,


texts: Magento 2: Run reindexer programmatically

texts: I am having a problem that I have costumer groups in our shop. When new customer is created and customer discount group is changed form BE. The customer cannot see their new prices. New customer sees there prices only after re-indexing. So I am looking for a way how to run reindexer after customer group change in BE using observer.


texts: How to add several input fields per entry - admin form in Magento2?

texts:
I want to be able to edit one poll and it's answers in one admin form, and have one input field per answer. I already have my collections ready, how can I create a working admin form ?

POLLS TABLE                   ANSWERS TABLE
PollId | PollText             AnswerId | PollId | AnswerText
 1     | 'Question1'           1       |  1     |  'Answer 1'
 2     | 'Question2'           2       |  1     |  'Answer 2'
                               3       |  2     |  'Answer a'
                               4       |  2     |  'Answer b'


texts: How to add validation for telephone number in magento customer registration form

texts:
I'm very new in magento and will appreciate if someone can give me a step-by -step procedure to 2 validations in the customer registration form in Magento 1.9.

The size of telephone number field should be 10 and numeric
Zipcode should not accept alphabets.


texts: Get the regular price from the order object when catalog discount is applied?

texts:
in Magento 2 how we can get the regular price for the product from the order object when the catalog discount is applied to the products.

As order object only return the discounted price and no discount information is present so we can get the actual price.

We can get the price by getting the product ID. but what is the product price change and we capture the order after that ??

foreach ($order->getAllVisibleItems() as $item) {
    $productID = $item->getProductId();
}


texts: Magento 1 - Logging only works in backend

texts:
I am unable to log anything in the frontend. I added the following code in the index.php, just below Mage::run:

Mage::Log('test from index.php', 7, 'test.log');

It is successfully logged if I reload the backend, but not if I reload the frontend? Why?

Logging is activated under System -> Configuration -> Developer Options -> Log Settings.

I set the permissions of the folder var recursively to 777 (chmod -R 777 var/)


texts: Category id filter to Magento 2 products collection

texts:
I want to add category id filter to Magento 2 product collection but it doesn't filter the collection in required manner. I am trying in below way:

$collection = $this->_productCollectionFactory->create()->addAttributeToSelect('*')
            ->joinField('category_id', 'catalog_category_product', 'category_id', 'product_id=entity_id', null, 'left')
            ->addFieldToFilter('category_id', ['nin' => 25]);

I don't want any product from category id 25 to be included in collection.


texts: Magento2 rest api add customer token in create customer api

texts:
i am using
magento 2.1.1
php version 7.0

this is my payload and response.

i want to add customer token in the response and i am using following magento 2 api :

http://host/index.php/rest/default/V1/customers

Example (*)
in the response i want to add seesion id in following response :

{
"id": 2278,
"group_id": 1,
"created_at": "2018-11-13 14:06:24",
"updated_at": "2018-11-13 14:06:24",
"created_in": "Default Store View",
"email": "test1023@gmail.com",
"firstname": "test",
"lastname": "lastName",
"store_id": 1,
"website_id": 1,
"addresses": [],
"disable_auto_group_change": 0
"session_id": "b5la2wrgxx00oqu83yuvqdthnqjv1tmv"
}

Hope you guys understand my problem


texts: Billing Information not saving at Checkout

texts:
When I fill in this form on checkout, It does not save
When I order something new, the fields are not filled in because its not saved.
I want to have the fields saved to the database in order to use those credentials.
Does anyone know how?


texts: I want to export all products from backend

texts: I want to add export option in MANAGE PRODUCT as same as shown in above image for ORDERS


texts:
I had moved my magento site to a new domain after following the proper transfer domain steps i had successfully moved my site by applying the necessary steps the home page is appearing perfectly  BUT the problem is i cannot access the inner pages i.e from the navigation http://thehubcollection.com/

When i try to access the inner pages i get the following error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.


texts: How to add %like% search functionality in header search Magento 2

texts:
When i search "cocacola" product it search 1 product which is "cocacola" but when i search "cola" then no product found. i want search "cola" and it should a product but right now no product found. i want use %like% condition.
I Want to add this functionality in header Search.

View Example
 In Magento 1 Search work like https://app.hyfy.io/v/abfCoSnOT5n/
 In Mahento 2 Search work like https://app.hyfy.io/v/ab3EtzbNT5n/
So Magento 2 Search Not Working Like Magento 1.


texts:
I want to add 2 step Authentication to an admin back end URL to my clients online Magento shop. I don't want to use a google app authentication or a phone app/sms system. I want a master Username/Password for the first step then my usual admin accounts.

I've been googling for a while but can't find anything except for SMS/App authentication, is there some other way I'm missing?


texts: M2.2 Configurable product with existing simple products - product list empty

texts:
I am trying to create a configurable product with existing simple products.

Catalog -> Product -> New Configurable Product

When I go to the Configuration option, I select Create configurations since Add products manually is not visible.

After I select the configurations and skip the priceand quantity fields now the option Add products manually is visible.

When I select that option however, the product list is empty and I get jQuery errors:


texts: Allow a specfik page to be found by search engines

texts:
I'm using a custom plugin for a case designer. It is placed in the app folder. But through my robots.txt that folder is disallowed for search engines.

The plugin is showing a page from a folder here

app/design/frontend/base/default/template/personaliseit/products

Is it just so simple to allow that full path now that i have disallowed app?

I don't want everything else indexed :)


texts:
I am trying to learn swagger in magento 2.

In core APIs of Magento 2 there is a required field cart_id.

I don't know what is this cart id and how can i find this ?


texts: Problem with Data URIs and CSS File Merge

texts:
Magento CSS file merge is pretending the hostname to my data-uris because the RegEx in Mage_Core_Model_Design_Package (beforeMergeCss) does not work as expected. It should prepend hostname to relative image paths, but not to Data URIs.

$cssUrl = '/url\\(\\s*(?!data:)([^\\)\\s]+)\\s*\\)?/';
$contents = preg_replace_callback($cssUrl, array($this, '_cssMergerUrlCallback'), $contents);

CSS-Code:

background: #fafafa url("data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iM3B4IiB2aWV3Qm94PSIwIDAgNiAzIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA2IDMiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwb2x5Z29uIHBvaW50cz0iNS45OTIsMCAyLjk5MiwzIC0wLjAwOCwwICIvPjwvc3ZnPg==") no-repeat;

Result after merge:

background: #fafafa url("http://shop12.dev/skin/frontend/shop/default/styles/data:image/svg+xml;base64")PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iM3B4IiB2aWV3Qm94PSIwIDAgNiAzIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA2IDMiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwb2x5Z29uIHBvaW50cz0iNS45OTIsMCAyLjk5MiwzIC0wLjAwOCwwICIvPjwvc3ZnPg==") no-repeat;

How to avoid this? I couldn't find out how to correct the synthax of the used RegEx. (Using a GIF is not a real solution to me)


texts:
We have installed Magento 1.9.2.4 in server.

We create new order in front-end not getting mail .It is issues only in front-end new order mail .

What is batter way to solved it .I checked other stack overflow issues related mail but not getting any solution .

Please help me.


texts: How to move Quick Access Bar to top of header

texts:
NEW QUESTION:

How to add a Cart Icon to header?

-

Hello everyone
I'm wondering how to move the
Quick Access Bar from
Below the catalog
 to
I'm assuming I need to edit code? Please help!
Thank you so much.
NEXT QUESTIONS:
-How can I make the bar a lighter gray?
-How do I fix the bar to the top of the website? (If I scroll down I can still see it)


texts:
i have problem importing product to magento using csv file

1: i have image url instead of image path , how can i save image from url as default magento takes path

2: it is difficult for layman to get catgory id and put in csv file.

i want to import product via catrgory name

cat 1 > child cat 1 > sub cat > rest product detail

how can i do this is there any module to do this


texts: What config setting have a selected to display this text at top of page

texts:
I have just migrated a very problematic site which has some major redirect issues, to try to fix this I have been changing all the settings within the config area and have managed to select one that has started to display some text at the top of every page. The text is along the lines of store view then some text so in this example it says 'Norwegian store view head text'

Does anyone know what Ive selected or how to get rid of this text?

Thanks


texts:
I'm working on a Magento store, containing 3,000 products, with a main stock and a main price updated automatically from SAGE (each 5 minutes).
Here is the specificity : products can be both IN THE MAIN STOCK and IN THE REFURB STOCK, with different prices. SAGE tell me, each 5 minutes, if the product is in the refurb stock, and what is the refurb price. That can concern 20 products, or 100 products in the same time.
For each product I have from SAGE:
- stock
- price
- stock_refurb
- price_refurb

I know about configurable product, but I think this is a pity to manage 9,000 products in the back-office (3,000 configurable, 3,000 simple in main stock, 3,000 simple in refurb stock), for maybe only 20 products in the refurb stock at the same time...

I have also thought about creating a simple temporary copy of the simple product (in main stock) when I have the product in the refurb stock, but I need to keep the historic of the orders for the customers. And if the Main stock product changes (description, images or else), I need to maintain the Refurb stock product consistant.

Am I missing something ?


texts: Magento 1: Apply catalog price rule if cookie set in customer system's browser

texts:
I am setting cookie in customer system's browser when customer comes from google ads, for that I had done some code for detecting that he/she is coming from google ads or not. In addition, when customer comes from google ads at that time I am setting some cookie in customer's browser.

I have created catalog price rule in admin and that rule is already activated, but I want to apply that rule if and only if customer's browser has some cookie value.

Does any one have any idea how to validate catalog price rules based on customer's browser cookie?


texts: Magento currency switcher not working in home page

texts:
In my magento site currency switcher is not working in home page only but after clearing cache only switching currency in home page
![enter image description here][1]


texts: I want to update qty on checkout page using ajax without page load in magento1

texts:
When I update my qty page reload I am using this code qty update but when I
    refresh page

 /* here is mu code */
  jQuery(document).ready(function(){
   jQuery('.btn-update').on('click',
    function(e){
      e.preventDefault();

        var form = jQuery(jQuery(this).closest('form'));

        // we'll extract the action and method attributes out of the form

        // kick off an ajax request using the form's action and method,
        // with the form data as payload
        jQuery.ajax({
            url: form.attr('action'),
            method: form.attr('method'),
            data: form.serializeArray()

        });

    }
);
});


texts: How to override template with block class in Magento 2.2.1

texts:
I want to override product main page title of product view page with block class.

So I use referenceBlock page.main.title with class like this

<referenceBlock class="Magento\Catalog\Block\Product\View" name="page.main.title" template="Vendor_Module::html/title.phtml"/>

But Magento 2.2.1 shows error like this: not allow attrbute class with referenceBlock

So how can i achieve this in Magento 2.2.1?


texts:
Today i implemented Lesti_Fpc which was a huge huge huge speed bump for the entire site. but i still struggle with the Cart and Checkout pages.
load times of around 6 to 9 sec. for the cart page.

What i've done

Redis cache as backup for FPC
mysql primer and added all improvements
emptied cache, locks, sessions
running daily clean scripts for log tables and such

What can be the issue?


texts: SQL error when run command line upgrade Magento 2

texts:
When I run the following commmand:
php bin/magento s:up;
It throws the following error:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'admin_magen34.mg7a_sm_products_filter' doesn't exist, query was: SHOW CREATE TABLE mg7a_sm_products_filter
  Can anyone help me with this problem?


texts: Add a custom fields account information section magento2 dashboard

texts:
We would like to a custom text field in my account dashboard account infomation section using custom module in magento2

Please find the screenshot below:

Thanks


texts: Attributes not displaying in all categories

texts:
I have a site which has been dormant for about a year and half. In between I kept coming back to it to make changes and now I've even forgotten what I had done to it.
Now, I had enabled attributes somehow by watching a youtube tutorial, and now the problem is that those attributes are not showing up in all categories. It's like they are showing up in 2-3, but the rest of the categories are attribute-less. Can anyone help me on this?
For categories with sub-categories, it's working only in the parent category.


texts: magento 2 How to customize product list pages of all subcategories under specific category?

texts:
I want to customize all subcategory pages whose parent category is 'Services'.
The customization includes following:

Remove Toolbar
Add filter for gender (gender is product attribute)
Add custom blocks
Display category filter instead of layered navigation.
Move layered navigation on the right under specific div

I tried to achieve most of the above using layout 'catalog_category_view_id_{{id}}.xml'. However the layout is not applicable to subcategories.

Please guide me in the right direction.


texts: How to override steps-wizard template file in magento 2.3?

texts:
How to override the steps-wizard template file in Magento 2.3?
I need to override Magento_ConfigurableProduct::catalog/product/edit/attribute/steps/select_attributes.phtml.
above file define in vendor/magento/module-configurable-product/view/adminhtml/layout/catalog_product_wizard.xml
Can anyone help me with this?


texts: How to put log in and log out option in header beside cart in magento?

texts:
I wants to change My Account to Log in Button in header beside cart option.
when user made log in then it should show log out option in header.

Please tell me the code with path.


texts: In magento2 command bin/magento upgrade not working for my custom module

texts:
Created one module and copied files in app/code but when i am doing bin/magento upgrade it's entry not showing in app/etc/config.php ?

also i tried writing entry in above file manually but when i do bin/magento upgrade it is deleting my entry.


texts: Add CMS Block to product view and category page

texts:
What is the best way of adding a CMS Block under the breadcrumb on a product listing page and a different one on a product view page.

Magento 1.9.


texts: Insert multiple rows without calling model save inside loop

texts:
Following code is working fine.

$data = $this->_customDataSave->create();
$data->setUsername($this->getUsername());
$data->setFullname($this->getFullname());
$data->setEmail($this->getEmail());
$data->save();

But I need to execute this piece of code in the loop to insert multiple of rows of data.
I don't want to call save inside loop.
How can I do that without calling save inside loop?


texts: Magento how to checkout one product from the customer dashboard

texts: I have a product whose price is 100$ and its a virtual product. I want to show that product in customer dashboard as a button and if customer clicks the button then he will be going for a checkout process of $100. I want the product should go to checkout from the customer dashboard.


texts: How to get configurable option on custom module

texts:
I want to display all configurable options same as details page in my custom module.

It should work like product details page(like below image) . any one have any idea ?


texts: Post Magento 2 Upgrade - Ineligible for Merchant Protection Eligibility

texts:
Since we upgraded a client from Magento 1 to Magento 2, every order placed via Paypal Website Payments Pro Hosted Solution has the Merchant Protection Eligibility as Ineligible.
A few people I have spoken to states that something needs to be done in the Paypal account in order to be eligible but I don't think the client had this issue in Magento 1 with the same payment method and Paypal configuration...
Is anyone able to advise what exactly needs to be done in order to be Eligible for Merchant Protection Eligibility please? I am bit stumped where else to ask where we can get a quick response.


texts:
I want to redirect to two different CMS Pages when a custom form is submitted.
Can any one help how we can do this. I'm trying form the .phtml template to get the CMS Page's ID and then redirect to that page.
Please correct me if I'm going wrong.

Thanks in advance,
regrards,
kiran.


texts:
I have installed an instance of Magento Commerce 2.2 on a server with Digital Ocean ensuring stack requirements are met and have been experiencing regular PHP Fatal Error Out of Memory Issues, and when checking the server stats it would seem that the CPU and memory usages are continuously reaching 100% usage.

All caching options are enabled, and we have around 10 people working on data input in the admin at the moment.

Would you be able to enlighten me as to what could be causing this?

I was considering upgrading hardware with my hosting provider but am worried that it will max resources out again if this is some kind of a memory leak...

Here are my specs:

4 GB Memory

60 GB Disk

Ubuntu 16.04.3 x64

Apache/2.4.28

MysQL Distrib 5.7.19

php 7.1

Magento 2.2 EE

I changed the memory_limit to 1024M

Some of the errors I am getting:

Fatal error: Out of memory (allocated 8388608) (tried to allocate 20480 bytes) in /path-to-magento/vendor/magento/framework/Serialize/Serializer/Json.php on line 37

Fatal error: Out of memory (allocated 8388608) (tried to allocate 20480 bytes) in /path-to-magento/vendor/magento/framework/Model/AbstractModel.php on line 227

Fatal error: Out of memory (allocated 8388608) (tried to allocate 20480 bytes) in /path-to-magento/vendor/magento/framework/Model/AbstractModel.php on line 227

Fatal error: Out of memory (allocated 2097152) (tried to allocate 65536 bytes) in /path-to-magento/vendor/composer/ClassLoader.php on line 444

Here is what the usage is looking like on my dashboard:

Server resource Usage Dashboard screenshot

Thanks!


texts:
I'm trying to override core Model Magento\Sitemap\Model\Sitemap with my own model My\Namespace\Model\Sitemap as follows,

<preference for="Magento\Sitemap\Model\Sitemap"    type="My\Namespace\Model\Sitemap" />

All other my overridden Models and Blocks are working fine, but for some strange reason, this override for Sitemap Model does not work,

My custom Model is almost same with only few changes inside of few methods.

<?php

namespace My\Namespace\Model;

class Sitemap extends \Magento\Sitemap\Model\Sitemap
{
    protected function _getSitemapRow($url, $lastmod = null, $changefreq = null, $priority = null, $images = null)
    {
        $url = $this->_getUrl($url);
        $row = '<locS>' . htmlspecialchars( $url ) . '</locS>';
        if ($lastmod) {
            $row .= '<lastmod>' . $this->_getFormattedLastmodDate($lastmod) . '</lastmod>';
        }
        if ($changefreq) {
            $row .= '<changefreq>' . $changefreq . '</changefreq>';
        }
        if ($priority) {
            $row .= sprintf('<priority>%.1f</priority>', $priority);
        }
        if ($images) {
            foreach ($images->getCollection() as $image) {
                $row .= '<image:image>';
                $row .= '<image:loc>' . htmlspecialchars($this->_getMediaUrl($image->getUrl())) . '</image:loc>';
                $row .= '<image:title>' . htmlspecialchars($images->getTitle()) . '</image:title>';
                if ($image->getCaption()) {
                    $row .= '<image:caption>' . htmlspecialchars($image->getCaption()) . '</image:caption>';
                }
                $row .= '</image:image>';
            }
            $row .= '<PageMap xmlns="http://www.google.com/schemas/sitemap-pagemap/1.0"><DataObject type="thumbnail">';
            $row .= '<Attribute name="name" value="' . htmlspecialchars($images->getTitle()) . '"/>';
            $row .= '<Attribute name="src" value="' . htmlspecialchars(
                $this->_getMediaUrl($images->getThumbnail())
            ) . '"/>';
            $row .= '</DataObject></PageMap>';
        }

        return '<url>' . $row . '</url>';
    }

    protected function _getSitemapIndexRow($sitemapFilename, $lastmod = null)
    {
        $url = $this->getSitemapUrl($this->getSitemapPath(), $sitemapFilename);
        $row = '<locS>' . htmlspecialchars( $url ) . '</locS>';
        if ($lastmod) {
            $row .= '<lastmod>' . $this->_getFormattedLastmodDate($lastmod) . '</lastmod>';
        }

        return '<sitemap>' . $row . '</sitemap>';
    }
}


texts: Although I use the correct namespace a wrong instance is passed to the constructor

texts:
I have a block php file.
Block File Code:

<?php

namespace Vendor\SampleModule1\Block;

use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Vendor\SampleModule1\Model\ResrouceModel\Item\Collection;
use Vendor\SampleModule1\Model\ResrouceModel\Item\CollectionFactory;

class Hello extends Template
{
    private $collectionFactory;

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

    /**
     * @return \Vendor\SampleModule1\Model\Item[]
     */
    public function getItems()
    {
        return $this->collectionFactory->create()->getItems();
    }
}

When I try to see the view the error is

  Fatal error: Uncaught TypeError:
      Argument 1 passed to Vendor\SampleModule1\Block\Hello::__construct()
      must be an instance of Magento\Framework\View\Element\Template\Context, instance of Magento\Framework\ObjectManager\ObjectManager given ....

How is that possible ? ? ?


texts: Price issue while customers does reorder in magento 1.9

texts:
I have a multiwebsite site. Retail and wholesale.
When my customer places an order on wholesale site, the order is placed properly. When they reoder the same order from the retail site, it shows the retail site price and not the wholesale site price. Refer https://nimb.ws/tcALJD https://nimb.ws/pJIitm https://nimb.ws/iObs2u
What is going wrong here? Can anyone suggest?


texts: Magento 2 Custom Module Cron Job often missed

texts:
I'm using Magento version 2.2.5 and I've created a cron job for my custom module, but it's often missed, first I setup the cron to run every 5 minutes

<group id="default">
  <job instance="Custom\Module\Cron\SyncTransaction" method="execute" name="lime_sepulsa_synctransaction">
    <schedule>*/5 * * * *</schedule>
  </job>
</group>

then I tried to fix it by setting up the cron to run every minute, but still got the same result

<group id="default">
  <job instance="Custom\Module\Cron\SyncTransaction" method="execute" name="lime_sepulsa_synctransaction">
    <schedule>* * * * *</schedule>
  </job>
</group>


texts: Magento - custom (non eav) model, load by multiple fields

texts:
I have a custom model and resource model.  I want to load a single instance of the model using more than 1 field.

The model has the following fields:

id
tag_name
custom_name
group_name

I want to load this model based on on tag_name, custom_name and group_name instead of id.

Currently i am using a collection and addFilter for each field. This works, but i wondered if there is a standard strategy for this type of thing in Magento?

EDIT

Core magento seems not to use collections for this scenario but instead it uses direct sql queries in the resource models.

an example of this is:

loadByAccountAndDate() in Mage_Paypal_Model_Resource_Report_Settlement

Is there a reason for this, when collections seem to be a more concise way, in terms of amount of code to be written

I just dont know why magento chooses to do it this way


texts:
Magento 2.1

We have a site setup with both English and French languages. We were noticing some french translations weren't showing on checkout page. Upon further inspection js-translation.json was missing.

Ran,

php bin/magento setup:static-content:deploy fr_FR -v

We get back the following error,

#0 /home/magento/public_html/lib/internal/Magento/Framework/App/View/Asset/Publisher.php(73): Magento\Framework\View\Asset\File->getSourceFile()
#1 /home/magento/public_html/lib/internal/Magento/Framework/App/View/Asset/Publisher.php(61): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))
#2 /home/magento/public_html/app/code/Magento/Deploy/Model/Deployer.php(445): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))
#3 /home/magento/public_html/app/code/Magento/Deploy/Model/Deployer.php(302): Magento\Deploy\Model\Deployer->deployFile('js-translation....', 'frontend', 'Magento/luma', 'fr_FR', NULL)
#4 /home/magento/public_html/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php(447): Magento\Deploy\Model\Deployer->deploy(Object(Magento\Framework\App\ObjectManagerFactory), Array, Array)
#5 /home/magento/public_html/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php(468): Magento\Deploy\Console\Command\DeployStaticContentCommand->deploy(Object(Magento\Deploy\Model\Deployer), Array, Array)
#6 [internal function]: Magento\Deploy\Console\Command\DeployStaticContentCommand->Magento\Deploy\Console\Command\{closure}(Object(Magento\Deploy\Model\Process))
#7 /home/magento/public_html/app/code/Magento/Deploy/Model/Process.php(53): call_user_func(Object(Closure), Object(Magento\Deploy\Model\Process))
#8 /home/magento/public_html/app/code/Magento/Deploy/Model/ProcessManager.php(41): Magento\Deploy\Model\Process->run()
#9 /home/magento/public_html/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php(486): Magento\Deploy\Model\ProcessManager->fork(Object(Closure))
#10 /home/magento/public_html/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php(371): Magento\Deploy\Console\Command\DeployStaticContentCommand->runProcessesInParallel(Object(Magento\Deploy\Model\Deployer), Array, Array)
#11 /home/magento/public_html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Magento\Deploy\Console\Command\DeployStaticContentCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /home/magento/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /home/magento/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Deploy\Console\Command\DeployStaticContentCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /home/magento/public_html/lib/internal/Magento/Framework/Console/Cli.php(96): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /home/magento/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /home/magento/public_html/bin/magento(23): Symfony\Component\Console\Application->run()
#17 {main}

Successful: 2729 files; errors: 1

Looking for information on what this error is exactly and any possible fixes.


texts:
I am testing out a few things on my site (Still isn't live) and I need to place an order on grouped and bundle deals, to see
 1. How it deducts the stock QTY from ERP
 2. If it will send me an order confirmation email.

The issue is when I am on the site and trying to place an order it's asking for payment and will not let me complete the order unless I put my credit card details in or use my PayPal account so it can deduct the payment.

My question is how can I get around this so it doesn't deduct payment from my account?

Thanks in advance for any help.


texts:
I have to add new field for shipping method in Fedex in admin panel?
If any idea about for that, please help asap.

System > Configuration > Sales > Shipping Method > Fedex

Thank you


texts: How to Update Editable Grid Data using Mass action?

texts:
I am very confuse How to Update the Editable Grid Data using Mass action.

I tried but it will got only Id in post. any one done this before then please guide me.

Please See the below Image If any one know the answer then let me know.


texts: XML tag to add array in cache tag for layout file

texts:
As magento1.9.2 is added cachetags function in to construct functon i must have to give seperate cachetags for each block element because its get conflict with varnish to read key. i have solved this issue in.phtml file to set key like below

 $this->getLayout()->createBlock('cms/block','',
         array(
         'cache_lifetime' => false,
         'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG."_twocmspages")
                          ))->setBlockId("twocmspages")->toHtml();

but if need to assign same cache_tags using xml with setMethod how can i do this.

<block type="cms/block" name="block_id">
... set cachetag here
</block>

Is any one has idea how to add cache_tag array arrgument from XML ?

your help will be appreciated here.


texts: I can't see the categories after migration to magento2

texts:
I migrate my store to magento2 (CE), but now I cant see the categories section, I get a error called: The store that was requested wasn't found. Verify the store and try again.

In my magento 1.9.x I had 2 stores, they are migrated but I can't see the categories part.

many thanks

Alfredo


texts: Magento-2 update product custom option value in custom add to cart process

texts: I want to update custom option value in add to cart. After add to cart i want to change product custom option value for perticular customer.


texts: Magento 2 - Minicart display subtotals incl. tax

texts:
When I adjust the option in Magento to display subtotals including tax the minicart breaks. I get this error in my console:

Uncaught ReferenceError: Unable to process binding "if: function (){return displaySubtotal() }"
Message: Unable to process binding "if: function (){return !display_cart_subtotal_excl_tax && display_subtotal_incl_tax }"
Message: display_subtotal_incl_tax is not defined

Does anyone have the same issue?


texts:
I am trying to understand following code (it is from Data.php). I am assuming it creates some sort of log file, but i can not figure out where can i find it. Can any one help me please? (It does not create file erply.log - i have searched it from all the directories).

class Eepohs_Erply_Helper_Data extends Mage_Core_Helper_Data {
 private $_filename = 'erply.log';
 public function log($message, $method = null, $line = null) {
  if ( Mage::getStoreConfig('eepohs_erply/general/log_enabled') ) {
   if ( is_null($method) ) $method = __METHOD__;
   if ( is_null($line) ) $line = __LINE__; Mage::log(sprintf('%s(%s): %s', $method, $line,
   print_r($message, true)), null, $this->_filename);
  }
 }
}

All the files associated with it are located in https://github.com/erplyopensource/magento-integration (i am just trying to understand the code)