texts:
in the link: https://sourceforge.net/apps/mediawiki/magmi/index.php?title=Image_attributes_processor

It has given as:

To set base image labels
image_label (label to use for image)
small_image_label (label to use for small_image)
thumbnail_label (label to use for thumbnail image)

A) What are Image labels?

B) Where should I set it?

BTW, below are my feed column names:

store,websites,type,attribute_set,is_affiliate_product,status,visibility,qty,is_in_stock,tax_class_id,weight,name,meta_keyword,description,sku,manufacturer,price,merchant_buy_link,remote_image_url,main_category,color,for,shoe_type,short_description,remote_thumbnail_image_url,category_ids,merchant_name,merchant_id,small_image

Below is 1 row sample data"

admin,base,simple,Affiliate Product,1,Enabled,"Catalog, Search",1,1,None,1,Ed Hardy Girls Bird Flower Cap - White,"handbags, wallets, designer handbags, prada, gucci, burberry",The  Ed Hardy&nbsp;Girls Bird Flower Cap  is an adorable cap for little girl.&nbsp;This cap features front tattoo  Bird Flower  graphics Embroidered print  adjustable Back  It also has printed text graphics with the words &#34; Ed Hardy &#34;. Your little,F58-EH5GH124UBRD,Ed Hardy,11.99,http://www.anrdoezrs.net/click-6521002-10569016?url=http%3A%2F%2Fwww.fashion58.com%2Fitemdetail.asp%3Fmod%3DEH5GH124UBRD,http://www.fashion58.com/itemimages/5GH124UBRD.jpg,Hats & Caps > Caps,White,,,The  Ed Hardy&nbsp;Girls Bird Flower Cap  is an adorable cap for little girl.&nbsp;This cap features front tattoo  Bird Flower  graphics Embroidered print  adjustable Back  It also has printed text graphics with the words &#34; Ed Hardy &#34;. Your little,http://www.fashion58.com/itemimages/5GH124UBRD.jpg,73,Fashion58,123,

C) Anything wrong in column names or sample data?

D) Iam unable to display product remote images in my site.. iam sure iam doing something wrong with Magmi.

pls kindly tell me..


texts: How do you backup magento Database through command line

texts:
I'm a beginner to these mysql. i used the command

  "mysqldump -u root -p magento > magentobackup.sql"

but returned a

  "Got error: 1036: Table 'catalogsearch_fulltext' is read only when
  using LOCK TABLES"

. whats the safe command to back up?


texts: Remote Images not displaying after running Magmi

texts:
I've installed Magmi, configured it and installed it too

Iam able to get products into my site, BUT prob is: Iam unable to see any image, since image urls all are from remote..

My image url looks like: http://www.fashion58.com/itemimages/SMS032-navy.jpg

Even iam not sure whether to change 'image renaming' or not, BUT at end all I need is : my remore image urls should able to display in my site..

Awaiting response!

EDITED:
My feed Column names are:  store,websites,type,attribute_set,is_affiliate_product,status,visibility,qty,is_in_stock,tax_class_id,weight,name,meta_keyword,description,sku,manufacturer,price,merchant_buy_link,image,main_category,color,for,shoe_type,short_description,thumbnail,category_ids,merchant_name,merchant_id,small_image

A) and Do I really need to use 'Image attributes processor' plugin inorder to display remote image urls?  or else Magmi just enough to render images for remote image urls?

B) If YES for 'Image attributes processor', what settings I need to change in it?

C) What could be still wrong?


texts: How to override default search result in magento 2

texts:
I want to override default Magento search result, as I am not getting idea from which file all data is displayed from which I want to filter the data.

Following are the requirements for overriding the result:

  I am working on a project where a single product is sold by multiple sellers currently using Magento default search.

  Following are my requirements

  I have created an attribute called "model_number" all products with the same model number and name should appear once.

  Example:- If the product name is "Photo Frame", model number is 1234 and that product is sold by multiple sellers, then search result should display only that product which has minimum price. In addition, Product with the same name and different model number should also appear.


texts: Fatal error: Call to a member function setTimerId() on boolean in ..\app\design\frontend\base\default\template\timer\index.phtml on line 1

texts:
I have installed a module of timer on banner in Localhost. It shows this fatal error.

In index.phtml code is

<?php echo $this->getChild('leonambernini.timerbanner')->setTimerId()->toHtml(); ?>


texts: Why do we need Block when we can write class in .phtml itself?

texts:
While we can write Class in .phtml itself, then why we need to go to Block. I'm not sure whether the module works without Block or not can anyone answer me with an explanation.

Thank you in Advance


texts:
I'm working with magento 2.

I can use ifconfig attribute in the block code, and it works well.

<block class="Magento\Catalog\Block\Category\View" name="category_desc_main_column" template="category/desc_main_column.phtml" ifconfig="config_path/group/field" before="category.products"/>

But I tried to use it for move, it didn't work.

<move element="category.image" destination="content" ifconfig="config_path/group/field" before="-"/>

Anyone know how to use it for moving?


texts: How to upgrade Magento 2.1.2 to 2.1.4 in Local Machine & Server side?

texts: How to upgrade Magento 2.1.2 to 2.1.4 in Local & Server?


texts: Create block and use it in template - Error filtering template: Invalid method

texts:
I created a block and a template. I call the template in a CMS site.

Block:

  \app\code\Fekete\Newsletter2Go\Block\Form.php

<?php
namespace Fekete\Newsletter2Go\Block;

/**
 * Dashboard Customer Info
 *
 * @api
 * @since 100.0.2
 */
class Form extends \Magento\Framework\View\Element\Template
{
    public $helper;
    /**
     * Constructor
     *
     * @param \Fekete\Newsletter2Go\Helper\Data $helperData
     * @param \Magento\Framework\View\Element\Template\Context  $context
     * @param array $data
     */
    public function __construct(
        \Fekete\Newsletter2Go\Helper\Data $helperData
        ,\Magento\Framework\View\Element\Template\Context $context
        ,array $data = []
    ) {
        $this->helper = $helperData;
        parent::__construct($context, $data);
    }

    /**
     * @return string
     */
    public function test()
    {
        return __('Hello Developer! This how to get the storename: %1 and this is the way to build a url: %2', $this->_storeManager->getStore()->getName(), $this->getUrl('contacts'));
    }

}

Template:

  \app\code\Fekete\Newsletter2Go\view\frontend\templates\partials\subscribe\form.phtml

<?php
/**
 * @var \Fekete\Newsletter2Go\Block\Form $block
 */
    echo $block->test();
?>

I call the template in the CMS page like this:

{{block class="Magento\Framework\View\Element\Template" template="Fekete_Newsletter2Go::form.phtml"}}

Result:

  Error filtering template: Invalid method
  Magento\Framework\View\Element\Template::test


texts:
I'm actually work on a Magento 2.3.4 website.
I try to access to Advanced Reporting, but when I click on the button on the BackOffice's homepage. It's redirect me on 404 error page...

Someone have already have this problem ?
Thanks in advance !


texts:
I'm trying to set some custom data for my block in local.xml:

<cms_index_index>
    <reference name="after_body_start">
        <block type="core/template" template="custom.phtml">
            <action method="setCustomData"><string>Sample data</string></action>
        </block>
    </reference>
</cms_index_index>

I would now assume that I can access this data in my custom.phtml template like this:

echo $this->getCustomData;
// or
echo $this->getData('custom_data');

But none of the above works and I can't figure out way?


texts: How do I enable bank transfer payment in backend only

texts: Is it possible to make a bank transfer payment method available only for manual order at the back-end?


texts: Problem when flat catalog product option 'yes/no' on getting brand attributes

texts:
I am getting all brands in my magento.When Flat catalog product is set to No, it fine. When it is no i got different result than i expected.

My Code

$attribute_code = array('apparelbrand','bagbrand','beltbrand','jewelrybrand','shoebrand','watchbrand');
foreach($attribute_code as $attribute_code)
    {
        $options= Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code)->getSource()->getAllOptions(false);
        foreach($options as $option)
        {
            $collection = Mage::getModel('catalog/product')->getCollection();
            $collection->addAttributeToFilter($attribute_code, $option["value"])->addAttributeToFilter('status', array('eq'=>1));
            if(count($collection->getAllIds())>0)//Checks whether the product exist for particular brand
            {
                Mage::log($option["label"].":".count($collection->getAllIds()));
                $cat[strtoupper(substr($option["label"],0,1))][]=$option["label"];//creates the multi-dimensional array of brand value with the starting character as key
            }
        }
    }

The above code results as

Flat Catalog Product = No

brand1 : 2
brand2 : 5
brand6 : 5
.
.
etc..

Flat Catalog Product = Yes

brand1 : 2
brand2 : 5
brand3 : 128
brand4 : 128
brand5 : 128
brand6 : 5
.
.
etc..

Why the count() returns 128 instead count even the brand does not have that much products.What could be the reason for this problem?


texts: Suggestion: Creating generic block class

texts:
I am displaying a customer attribute in frontend as per the configuration settings (the attribute can be displayed as dropdown, checkbox etc.)

I have used block class for the purpose so that I can use the same template file in different pages (for example: register, checkout pages etc.).

The block class structure looks like:

MagePsycho/Customer/Block/Widget/Abstract.php
MagePsycho/Customer/Block/Widget/Type/Dropdown.php
MagePsycho/Customer/Block/Widget/Type/Checkbox.php
MagePsycho/Customer/Block/Widget/Type.php

To display the attribute, you have to include the following code in .phtml:

<?php echo $this->getLayout()->createBlock('magepsycho_customer/widget_type')->setObject($this->getFormData())->toHtml() ?>

From this you can assume that Type.php acts as a pseudo factory class for generating the required attribute type:

class MagePsycho_Customer_Block_Widget_Type extends MagePsycho_Customer_Block_Widget_Abstract
{
    public function _toHtml()
    {
        if ($someConditionToShowDropdown) {
            return $this->getLayout()->createBlock('magepsycho_customer/widget_type_dropdown')->setObject($this->getObject())->toHtml();
        } else if ($someConditionToShowCheckbox) {
            return $this->getLayout()->createBlock('magepsycho_customer/widget_type_checkbox')->setObject($this->getObject())->toHtml();
        }
        return '';
    }
}

I could have added the presentation logic of _toHtml() in .phtml but to make it look cleaner, I decided to move it to some generic block class Type.php.

My Question here is, what is the better way to generate the block class/template based on conditions.
Is the way I am doing is correct? Any Suggestions?


texts: Magento 2.3.4 : 404 Not Found The resource requested could not be found on this server!

texts:
Magento 2.3.4: Installation Successfully but showing this error: admin panel and store address both are showing this: 404 Not Found The resource requested could not be found on this server!

.htaccess and .htaccess.sample is also there.

max_execution_time  - 1800
max_input_time - 1800
memory_limit - 1024M

Can anyone help me in this to start my front and backend?


texts: Save customer custom attributes without clear caches

texts:
Every time I need to clear cache when saving customer attributes using the following code.

$customerData->setCustomAttribute('custom_name', $name);
$customermodel->updateData($customerData);

what is the proper solution to save customer custom attributes in Magento2?


texts: How to send mails to diferent sales representatives for diferent stores?

texts:
I have an issue with my sales representatives emails in Magento version 1.9.3.2.

I have 2 stores in my site and I have created different transactional emails for each store.

When I check Use Website checkbox  at System-Configuration-General-Store Email Addresses and at System-Configuration-Sales-Sales emails all transactional emails was sent without problems.

Due to this behavior I have deduced that my mails and cron systems are correctly setup.

But when I try to set a different sales representative for each store following Documentation, Magento don't send any email.

What can I do to send different emails to each sales representative?

Thanks in advance.


texts: How to change product status from sql using SKU

texts:
I need to disable and enable a huge quantity of products filtering by sku and the easiest solution seem to be through Sql query but i have some issues to find the right code
For example i need to disable 10000 products Sku: 001, 002, 003, 004, etc... i've found the right code for magento 1.9 but for magento 2 it's not working


texts: Magento 2.4.2 GraphQL not get uid from customerCart and cart query

texts:
I installed Magento 2.4.2
According to Magento GraphQL DevDocs updateCartItems mutation cart_item_id is Deprecated. Use cart_item_uid instead. The unique ID assigned when a customer places an item in the cart.
I can not get cart item's uid from customerCart and cart query.
Please help me.


texts: How to get quantity of each product in cart magento 1.9

texts:
After added products to cart, we can get all qty in cart. But I want to get qty of each product, how to do? Thanks.

This is my cart I added product. I want to get qty of each product, example: product 1( item 1 and 2) qty = 4


texts: Magento Error Handling *and* PHP INI error_log configuration

texts:
I have a problem marrying Magentos Error Handling with my PHP configuration settings for error_log and log_errors in ther server configuration.

I'm using both the application as well as the Magento PHP API like

require 'path/to/magento/app/Mage.php';
Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
...

which initializes the Magento application as well.

As you might know, this also registers the Magento PHP error handler so that Magento can introduce it's own logging system.

However from what I've noticed, it also resets the php.ini configuration settings for the standard PHP error log (and probably as well the error level depending on own settings and if Magento runs in Developer Mode or not). This behaviour is also suggested in context of Large "error_log" file .

As there can't be much done about the error level, I'm not so much concerned about the level.

What I'm looking for is that the Magento system at least respects my error_log and log_errors setting because the error handler can't catch problems at the level of execution time (at least this seems to me, I'm missing some very grave error situations logged in the Magento /var/log/ folder).

Is there any way to let Magento do what it does (Magento's own error handling) but also configure it to respect the PHP error log settings? At best with not editing core, so I ask.

I currently use Magento Version 1.5 but I assume this is the same for other versions, too.


texts: How to get latest category on magento 1.9.2.4?

texts:
In Magento 1.9: I have to show latest added category's description on template.

So how to get latest category?


texts: get product image url from getItemsCollection

texts:
I'am trying to get the image product url from getItemsCollection generated by Mage_Reports_Block_Product_Viewed. Here is my code. Everything is working except getImageUrl()

$nb = 3;
$already_used = array();
$collection = Mage::getSingleton('Mage_Reports_Block_Product_Viewed')->getItemsCollection();
foreach ($collection as $item){
    if ($nb > 0)
    {
        ?>

                <a href="<?php echo $item->getProductUrl(); ?>"><img src="<?php echo $item->getImageUrl(); ?>" alt="<?php echo $item->getName();?>" />

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

        <?php
        $already_used[] = (int)$item->getProductId();
    }
    $nb--;
}

I don't understand what is wrong in my code...

Thank you for your help !


texts:
I've successfully migrated a complete magento 1.9 database with 900 products to a 2.2.6 using the data migration tool.

Now I wonder how to change the product name scope from global to store view. We need each product to have it's own name on each view.

As you can see, it's actually set to global and if I change it on one store the changes are applied to the other views. That's not the behavior that we need.

Thanks!


texts: I am trying to write a helper class for my module. The helper class will provide two methods with various functionality. Can I put this helper class beside the other helper class in my .../Helper/Data.php file or should I put it somewhere else? Also, how should I reference it from other parts of Magento in order to get access to its methods?


texts: Magento 2.4.2-p1 issue with Elastic Search

texts:
I am facing below issue after upgrade from Magento 2.3.5 to Magento 2.4.2-p1 version.
Exception #0 (Elasticsearch\Common\Exceptions\BadRequest400Exception): {"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:234] [histogram] failed to parse field [interval]"}],"type":"x_content_parse_exception","reason":"[1:234] [histogram] failed to parse field [interval]","caused_by":{"type":"illegal_argument_exception","reason":"[interval] must be >0 for histogram aggregation [prices]"}},"status":400}

How can we resolve this issue?
Thanks


texts:
Due to the way the toolbars are added on the category page view showing products, there is no way to target it specifically.

If you try the layout xml argument it only passes the data to the block, it does not set the class on the toolbar.

I cannot target only one of them with css or php due to the way they are being rendered, how can I get an additional class on only one of the toolbars?

The block and template in question:

<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">


texts: How to set default option on configurable product dropdown attribute?

texts:
ow to set first value attribute as selected for a configurable product?
Front-end:

Size:

Choose an Option... (selected)

Small

Medium

I would like to change it to...

Size:

Small (selected)
Medium

configurable.phtml
<?php
$_product    = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
$_jsonConfig = $this->getJsonConfig();
$_renderers = $this->getChild('attr_renderers')->getSortedChildren();
?>
<?php if ($_product->isSaleable() && count($_attributes)):?>

    <?php foreach($_attributes as $_attribute): ?>
        <?php
        $_rendered = false;
        foreach ($_renderers as $_rendererName):
            $_renderer = $this->getChild('attr_renderers')->getChild($_rendererName);
            if (method_exists($_renderer, 'shouldRender') && $_renderer->shouldRender($_product, $_attribute, $_jsonConfig)):
                $_renderer->setProduct($_product);
                $_renderer->setAttributeObj($_attribute);
                echo $_renderer->toHtml();
                $_rendered = true;
                break;
            endif;
        endforeach;

        if (!$_rendered):
        ?>

*<?php echo $_attribute->getLabel() ?>

        <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>

                <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
                    <option><?php echo $this->__('Choose an Option...') ?></option>
                  </select>

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

<?php
$jsonConfig = json_decode($this->getJsonConfig());
$jsonConfig->chooseText = $_attribute->getLabel();
?>

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


texts: Apply base shipping cost for all orders to show in header_minicart

texts:
I am looking for a way if possible to apply a base shipping cost to all orders that will display in the mini cart in the header then when the customer goes to checkout they can get a more accurate shipping estimate using the normal functions.

Firstly is this possible

Secondly if it is would any one know where I could start.

Used the answer below with this in /checkout/cart/minicart/items.phtml around line 82;
<?php
         $totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object
         $grandtotal = $totals["grand_total"]->getValue(); //Grandtotal value
         echo $formattedPrice = Mage::helper('core')->currency($grandtotal , true, false);
        ?>

my header now displays subtotal and an estimated grandtotal.


texts:
I'm using Braintree payment gateway and having issues when tying to make a payment through REST API. I am calling carts/mine/payment-information endpoint with following values.

Header:

Authorization: Bearer customer-token
Content-type: application/json

Body:

{
  "paymentMethod": {
    "po_number": "",
    "method": "braintree",
    "additional_data":{
        "cc_last4":"1111",
        "store_in_vault":true,
        "payment_method_nonce":"nonce-goes-here",
        "cc_token":"",
        "device_data":"",
        "cc_type":"Visa",
        "cc_exp_year":"2055",
        "cc_exp_month":"01"
    },
    "extension_attributes": {
      "agreement_ids": [
        "string"
      ]
    }
  },
  "billingAddress": {
    "id": 0,
    "region": "Victoria",
    "region_id": 546,
    "region_code": "VIC",
    "country_id": "AU",
    "street": [
      "Main St"
    ],
    "company": "Company Name",
    "telephone": "987654321",
    "fax": "",
    "postcode": "3000",
    "city": "Melbourne",
    "firstname": "Firstname",
    "lastname": "Lastname",
    "middlename": "Middlename",
    "prefix": "Mr",
    "suffix": "",
    "vat_id": "",
    "customer_id": 0,
    "email": "name@domain.name",
    "same_as_billing": 0,
    "customer_address_id": 0,
    "save_in_address_book": 0,
    "extension_attributes": {},
    "custom_attributes": {}
  }
}

I have generated a braintree token and used that token to generate the nonce. With the use of nonce, I was able to create a Braintree transaction as below.

   $result = Braintree_Transaction::sale([
        'amount' => $transactionAmount,
        'paymentMethodNonce' => $nonceFromTheClient,
        'options' => [
            'submitForSettlement' => True
        ]
    ]);

The transaction gets successful but when I try to place an order on Magento using my transaction details, I keep getting the following error.

  Transaction has been declined. Please try again later

Can anyone advise me what's wrong with my process/ request please?

Thanks!


texts:
I recently updated my Magento to 1.8.0.1 to 1.9.2.4, after that is some code which is not working the way it was working before. In one of my custom module(purchased module)
there was a collection filter like this-

$weekCollection = Mage::getModel('mymodule/mymodel')->getCollection()
         ->addFieldToFilter('id',16)
         ->addFieldToFilter('week(created_time, 1)',$week);

it's sql query was

SELECT `main_table`.* FROM `table_name` AS `main_table` WHERE (`id` = '16') AND (week(`created_time`, 1) = '13')

this query was working fine in older veriosn

after updating magento  the query for that code is

SELECT `main_table`.* FROM `table_name` AS `main_table` WHERE (`id` = '16') AND (`week(created_time, 1)` = '13')

this is returning errror of  Unknown column 'week(created_time, 1)' in 'where clause'

What change should I make in addFieldToFilter  code to make the sql query same?


texts: Custom API not working when use "all" in url

texts:
I have created a custom API which is working fine with:
curl -X POST "http://127.0.0.1/magento2.4/index.php/rest/V1/wishlist/add/3" -H "Authorization: Bearer l65lqwa5z649dg45gbx8in0jdfdgdgxoa665f"

But not working with Swagger as it added all to URL like
curl -X POST "http://127.0.0.1/magento2.4/index.php/rest/all/V1/wishlist/add/3" -H "Authorization: Bearer l65lqwa5z649dg45gbx8in0jdfdgdgxoa665f"

Do we need to adjust anything to work on both URL i.e with and without all ?
Thanks in advance!


texts:
Hi Guys I'm getting error while running yarn run build error and Screenshot is attached in below. Help will be appreciated, Thanks :)

FetchError: request to http://magento2/graphql failed, reason: getaddrinfo ENOTFOUND magento2 magento2:80
    at ClientRequest.<anonymous> (/var/www/html/magento2/pwa-studio/node_modules/node-fetch/lib/index.js:1455:11)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  message:
   'request to http://magento2/graphql failed, reason: getaddrinfo ENOTFOUND magento2 magento2:80',
  type: 'system',
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND' }
Hash: 82f799d2ec3be1983d77
Version: webpack 4.29.6
Time: 8685ms


texts: How to get dropdown in action column in magento admin grid

texts:
I want to get dropdown of edit & delete in action column of admin grid in magento2 as like mention in the image. How it is possible?

$this->addColumn(
    'delete',
    [
        'header' => __('Action'),
        'type' => 'action',
        'getter' => 'getId',
        'actions' => [
            [
                'caption' => __('Delete'),
                'url' => [
                    'base' => 'abc/*/delete'
                ],
                'field' => 'abc_id'
            ]
        ],
        'filter' => false,
        'sortable' => false,
        'index' => 'stores',
        'header_css_class' => 'col-action',
        'column_css_class' => 'col-action'
    ]
);


texts: Dealing with neutered type hinting in Magento

texts:
Just wondering if anyone has better strategies than I've thought of for type checking to co-exist with Magento's custom error handler. Specifically, I'm wondering about a "Catchable Fatal Errors" as thrown in the case of a typehinted parameter mismatch. Here's an example from the Mage class:

/**
 * Write exception to log
 *
 * @param Exception $e
 */
public static function logException(Exception $e)
{
    if (!self::getConfig()) {
        return;
    }
    $file = self::getStoreConfig('dev/log/exception_file');
    self::log("\n" . $e->__toString(), Zend_Log::ERR, $file);
}

Because of the error handler, anything can be passed to the method, including a Zend_Date (which will work fine, but look super confusing in your exception log), or a Mage_Core_Model_App, which actually will have a fatal error.

It's possible to re-implement type checking at the top of a method: $e instanceof Exception but such tactics defeat the purpose of a typehint.

Any hints suggestions?


texts: Magento 2: theme xml for custom phone validation in checkout

texts:
I've created my own validation rule phonePL in

app/design/frontend/Me/myskin/Magento_Ui/web/js/lib/validation/rules.js

I can activate it in

Magento/Checkout/view/frontend/layout/checkout_index_index.xml

By adding my validation rule in telephone item like so:

<item name="telephone" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="validation" xsi:type="array">
            <item name="phonePL" xsi:type="string">true</item>
        </item>
        <item name="tooltip" xsi:type="array">
            <item name="description" xsi:type="string" translate="true">For delivery questions.</item>
        </item>
    </item>
</item>

But how should I overwrite just this one telephone item in my theme? I dont want to do it directly in magento directory. I've got an xml file:

app/design/frontend/Me/myskin/Magento_Checkout/layout/checkout_index_index.xml

but I don't know what exactly should its structure look like?


texts: Get pending, completed, processing orders REST API problem

texts:
I have an API module to get orders with any status for a specific customer.

I am calling the API as :

https://{{magento-store}}/index.php/rest/V1/order/myorder?status=processing
and authoriaztion : bearer token_number in header.

but, I always get an empty array. so please help.

Here is my code.

di.xml into app/code/Ipragmatech/Restfulapi/etc/ :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="Ipragmatech\Restfulapi\Api\OrderInterface" type="Ipragmatech\Restfulapi\Model\Order" />
</config>

webapi.xml into app/code/Ipragmatech/Restfulapi/etc/ :

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<!-- Routing define -->
<route url="/V1/order/myorder" method="GET">
<service class="Ipragmatech\Restfulapi\Api\OrderInterface" method="myorder"/>
<resources>
<resource ref="self"/>
</resources>
<data>
<parameter name="customerId" force="true">%customer_id%</parameter>
<parameter name="status" force="true">%status%</parameter>
</data>
</route>
</routes>

OrderInterface.php into app/code/Ipragmatech/Restfulapi/Api/ :

<?php

namespace Ipragmatech\Restfulapi\Api;

interface OrderInterface
{

/**
* Return orders.
*
* @param int $customerId
* @param string $status
* @return array
*/

public function myorder($customerId, $status);
}

Order.php into app/code/Ipragmatech/Restfulapi/Model/ :

<?php

namespace Ipragmatech\Restfulapi\Model;

use Ipragmatech\Restfulapi\Api\OrderInterface;

/**
* Defines the implementaiton class of the calculator service contract.
*/
class Order implements OrderInterface
{
public function myorder($customerId, $status) {
if(empty($customerId) || !isset($customerId) || $customerId == "" || empty($status) || !isset($status) || $status == ""){
throw new InputException(__('Id required'));
}
else{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$orders = $objectManager->create('Magento\Sales\Model\Order')->getCollection()->addFieldToFilter('status', $status)->addFieldToFilter('customer_id',$customerId);
$orderData = array();
if(count($orders)){
foreach ($orders as $order){
$data = array("order_id"=>$order->getEntityId(),"status"=>$order->getStatus(),
"amount"=>$order->getBaseGrandTotal(),
"order_date"=>$order->getUpdatedAt()
);
$orderData[] = $data;
}
return $orderData;
}
else{
return $orderData;
}
}
}
}

di.xml file into app/code/Ipragmatech/Restfulapi/etc/webapi_rest/ for customer authoriaztion:

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\Authorization">
    <plugin name="customerAuthorization" type="Magento\Customer\Model\Plugin\CustomerAuthorization" />
    </type>
    <type name="Magento\Authorization\Model\CompositeUserContext">
    <arguments>

<argument name="userContexts" xsi:type="array">
<item name="customerSessionUserContext" xsi:type="array">
<item name="type" xsi:type="object">Magento\Customer\Model\Authorization\CustomerSessionUserContext</item>
<item name="sortOrder" xsi:type="string">20</item>
</item>
</argument>
</arguments>
</type>
</config>


texts: Adding Color attribute option in Magento Admin

texts:
How can I add extra Color attribute options ( blue, black , etc) which are not already show in Magento admin when adding configureable / simple products..

I did it a few months ago, it was some database hack, involved two tables I think so and that was by following a tutorial.

Can anyone suggest an improved way.


texts: Magento product filename and path on the server

texts: Is it possible to run a query which returns sku, product image (single or multiple) file path and filename on magento?


texts:
Magento 2 still sending cron emails in English.

I know in Magento 1.9 is a recognized bug, but I tried with the fixed known and it doesn't works.

I need to translate the product alert emails.

Any solution?


texts:
How can implement search box in attribute list on my Magento template?

Another example is on yoox.com.


texts: Show multishipping order details to only one order detail

texts:
When we do multishipping order, there will be multiple orders created, could i made it only one order, but there are multiple order inside? I already tried to made only one order, and i saved the multiple orders to my custom table so i could get the orders. But i can't made the orders show inside only one order detail. Check the picture below for more explaination.

Order Detail :

So, what i mean is, if i do shipping with 2 addresses, there will be 2 details inside 1 order detail (content inside the red line in pictures). Can i do that?


texts: Magento Cloud - how to set my key for magento

texts:
How do I setup New Relic license key for my magento on the magento cloud? I don't use Magento CLI often

magento-cloud variable:set php:newrelic.license AAAAAAAAAAAAAAAAAAAAAAAAAAA

I execute above by SSH

but it gave me this


texts: Why does price.phtml take so long to load?

texts:
I have just launched a new Magento 1.9.1.4 site that has been in development for a long time. Right before launch, I went through my "speed up" checklist:

Compilation: on
Caching: on
Flat databases: on
Combine CSS/JS: on
Logging: off
GZip: on
Plus several other trivial tweaks...

However, I was still getting a page load time of 12-16 seconds on my category pages! After enabling the profiler, I started at the bottom of the list (innermost child code?) and found the following lines with high time and memory usage:

| Code Profiler | Time | Cnt | Emalloc | RealMem |
|---------------|------|-----|---------|---------|
| frontend/{package}/{theme}/template/catalog/product/price.phtml | 10.1435 | 27 | 14,295,328 | 20,971,520 |
|---------------|------|-----|---------|---------|
| CONFIGURABLE:Mage_Catalog_Model_Product_Type_Configurable::getConfigurableAttributes | 9.8808 | 27 | 13,653,472 | 19,398,656 |
|---------------|------|-----|---------|---------|
| TTT2:Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection::_afterLoad | 3.3624 | 27 | 9,510,240 | 15,204,352 |
| CONFIGURABLE:Amasty_Conf_Model_Catalog_Product_Type_Configurable::getUsedProducts | 3.3584 | 108 | 10,730,968 | 15,204,352 |
|---------------|------|-----|---------|---------|
| TTT4:Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection::_afterLoad | 5.1512 | 27 | 3,266,096 | 3,407,872 |
|

So, thinking I royally screwed up the code in my theme's price.phtml, I removed it from the server to test using Magento's default price.phtml. However, I found that code to be only marginally better:

| Code Profiler | Time | Cnt | Emalloc | RealMem |
|---------------|------|-----|---------|---------|
| frontend/base/default/template/catalog/product/price.phtml | 8.8124 | 27 | 14,278,832 | 20,971,520 |
|---------------|------|-----|---------|---------|
| CONFIGURABLE:Mage_Catalog_Model_Product_Type_Configurable::getConfigurableAttributes | 8.6064 | 27 | 13,649,584 | 19,136,512 |
|---------------|------|-----|---------|---------|
| TTT2:Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection::_afterLoad | 3.0117 | 27 | 9,509,048 | 14,942,208 |
| CONFIGURABLE:Amasty_Conf_Model_Catalog_Product_Type_Configurable::getUsedProducts | 3.0080 | 108 | 10,730,480 | 14,942,208 |
|---------------|------|-----|---------|---------|
| TTT4:Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection::_afterLoad | 4.4072 | 27 | 3,263,456 | 3,407,872 |
|

So, it seems that I'm missing something here to get the site/server into production mode or something is really messed up with the product structure. Can someone lend a hand as to why Magento's default files (and my custom theme files) are taking so long to load after optimization?

Note: The above specs are from a category page in grid view with 27 products (obviously from the "Cnt" column).


texts: Options values of attribute "visibility"

texts:
I am looking for the option values for the attribute visibility. We have a import script running, which is delivering all articles to magento and automatically sets the visibility for simple products to "Katalog and Search" which is value 4.

So now I want to change that to make the simple products visible just through "Search". I was searching for the value within the MySQL database but couldn´t find anything yet.
Does anyone of you know or have an idea in which table to find that option values of visbility?

Would be great if anybody could help me on this.


texts: Custom product collection filter doesnt work with Magento 2 elasticsearch ( but work with mysql)

texts:
I am using Magento 2  with elastic search enabled. I have a custom filtering of the product collection.

Now, when elastic search is enabled, custom filtering don't work however with MySQL search, it does work.

Any idea what's causing the issue or how elastic search is creating the product collection query?


texts: Sorting by position not working with Elastic Search 6+ on magento 2.3.3

texts: When I use mysql as a default search engine in magento 2.3.3 everything works fine as it should but as I change the default search engine to Elastic Search 6+ the sort by position attribute does not position the products as it should instead it orders them randomly ,please tell me what should I do


texts: Local copy of site won't load. Fatal error: Call to a member function setParent() on a non-object in lib/Varien/Simplexml/Element.php on line 444

texts:
I have mirrored an EE 1.14 site to my local server to work on. I've followed my normal procedure for doing so - change base urls, modify local.xml, dump caches and session.

However, when I try to navigate to the site, or even to the magicento eval.php (/home/user_name/public_html/site_new/site/html/var/magicento/eval.php), I get this error:

  Fatal error: Call to a member function setParent() on a non-object in
  /home/user_name/public_html/site_new/site/html/lib/Varien/Simplexml/Element.php
  on line 444

Looking at the code in that area, I can see that Magento is trying to set the parent on a newly created child :

if (is_null($targetChild)) {
        // if child target is not found create new and descend
        $targetChild = $this->addChild($sourceName);
        $targetChild->setParent($this); //Line 444 which throws error.
        foreach ($source->attributes() as $key=>$value) {
            $targetChild->addAttribute($key, $this->xmlentities($value));
        }
    }

In system.log, I am getting this error :

  Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild.html]:
  Element name is required  in
  /home/user_name/public_html/site_new/site/html/lib/Varien/Simplexml/Element.php
  on line 443

So I looked back in the extendChild function a bit and added some debugging code :

// name of the source node
        $sourceName = $source->getName(); // Standard Magento call
       //Debug code follows :
        if(!$sourceName){
            echo "<pre>";
            echo print_r($source);
            echo "</pre>";
        }

The if(!$sourceName) check gets hit once per load. The output I get from the print_r is this, including the '1' at the end:

Mage_Core_Model_Config_Element Object
(
    [192.168.5.112] => Mage_Core_Model_Config_Element Object
        (
            [~user_name] => Mage_Core_Model_Config_Element Object
                (
                    [site_new] => Mage_Core_Model_Config_Element Object
                        (
                            [site] => Mage_Core_Model_Config_Element Object
                                (
                                    [html] => Mage_Core_Model_Config_Element Object
                                        (
                                        )

                                )

                        )

                )

        )

)
1

I'm at a loss as to why this is happening. I've turned off rewrites, js and css compilation, set ownership to webserver:webserver, and a few different permission configurations (settled on 755/644).


texts: Magento Remove/Hide Shipiing and Handling and Discount in cart page

texts: In Magento 1.9.3.4, How to Remove/Hide Shipiing and Handling and Discount in cart page.


texts: Blank Page When Installing Magento Open Source 2.2.2

texts:
I am getting the following error when trying to run the initial php setup script, please advise

$ php bin/magento setup:install
Fatal error: Declaration of Zend\Mvc\Controller\PluginManager::get($name, ?array $options = NULL) must be compatible with Zend\ServiceManager\AbstractPluginManager::get($name, $options = Array, $usePeeringServiceManagers = true) in /srv/http/magento/vendor/zendframework/zend-mvc/src/Controller/PluginManager.php on line 211

My Setup:

$ php -version
  PHP 7.2.0 (cli) (built: Dec  5 2017 18:56:10) ( NTS )
  Copyright (c) 1997-2017 The PHP Group
  Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies


texts: set up magento 2 change all to https, now only html - no css js and I can access admin as login fails

texts:
I've set up magento 2 and changed all urls to https, now only html shows on the site - no css js and I now can't access admin as login fails.

I've checked out docs, forum, stack exchange and tried changing in mysql via phpmyadmin to no avail.

Surely this is something that most noobs do as we all want to set to secure right?
So why is it too easy to do this and why are there no warnings on the docs?

Maybe I just need to completely reinstall Magento 2 again as it's taken me hours to try to figure it out.
Any help is much appreciated.


texts: When updating layout handle how to call custom action from the block?

texts:
When updating layout handle i need to call some function from block from which i am updating. I want to basically to set some menu links as active but no success with this code

    <customer_account_myact>
        <update handle="customer_account">
            </update>
            <reference name="left">
                <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
                    <action method="setActive"><path>customer/account/MyServices/</path></action>
                </block>
            </reference>
    </customer_account_myact>

When I do 'update handle="customer_account"', it renders the all links in left sidebar menu, but what i need is to make certain link "active" so i am trying to to refer to block to call the action from there.

This is all i want, but when i do so it breaks all stuff and no links are rendered.

If i can, I suppose it should be possible to re declare all the links via xml and calling the block method, but i believe that there should be an easier, and, more correct way of doing this, just to leave it as is, but calling the method from block?

thanks!


texts: Process to create partial credit memo/refund for Paypal Standard orders

texts:
I see a number of issues reported that if an administrator sends a partial refund to a customer via Paypal then Magento receives an IPN that causes the whole order to be marked as Refunded (e.g. https://collaborate.magento.com/magento/topics/paypal_refunds_and_automatic_credit_memo_generated).

Is it possible to issue a partial refund by creating an Online Credit Memo within the Magento invoice view?

What is the best approach for this scenario? Please note that this applies to Paypal Standard (not Express or other integrations).


texts: Magento 1.9 line 1: parser error : Start tag expected, '<' not found in /home2/

texts:
my site was working fine but now when i open product editing page from backend (admin panel ) it shows me error .
2020-11-07T10:36:31+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '&lt;' not found  in /home2/fillcraf/public_html/lib/Varien/Simplexml/Config.php on line 510

2020-11-07T10:36:31+00:00 ERR (3): Warning: simplexml_load_string(): /*   in /home2/fillcraf/public_html/lib/Varien/Simplexml/Config.php on line 510
2020-11-07T10:36:31+00:00 ERR (3): Warning: simplexml_load_string(): ^  in /home2/fillcraf/public_html/lib/Varien/Simplexml/Config.php on line 510
is anybody know how to fix it ? Help me its urgent


texts:
I have a a module that makes a soap call to a service to retrieve live shipping quotes, and it returns a bunch of data, an import fee being one of those things it returns.

I have created a new AbstractTotal class called ImportFee and I need a way to set the amount of this fee to be the amount of the user's selected shipping rate's import fee. I have already stored the import fee on my shipping rates in an extension_attribute, I just do not know how I am supposed to obtain the object from the AbstractTotal class.

If some code is needed, please ask which code would be specific. I do not want to spam this with a bunch of code. The concept is the same.

I have an extension_attribute on my shipping rate, and I need to set an AbstractTotal class value to that extension_attribute. Thanks!


texts: Magento 1.9 Changing Totals Layout and Calculations

texts:
I want to change to layout of order totals on review, print, email and admin panel
somehow i manage to do that with cod fee its showing perfect as screenshot attached
COD Fee
Vat (5%)
Subtotal
Same i want to do that with
Shipping and Subtotal of products
from the backend i mange to bring price with and without tax but showing tax in separte line for each total ( subtotal and shipping total )

also i want to remove that tax line


texts: send mail to admin gives error Invalid sender data

texts:
post.php

<?php
namespace Magneto\WholesaleApplication\Controller\Index;

use Zend\Log\Filter\Timestamp;

 class Post extends \Magento\Framework\App\Action\Action
{
const XML_PATH_EMAIL_RECIPIENT_NAME = 'trans_email/ident_support/name';
const XML_PATH_EMAIL_RECIPIENT_EMAIL = 'trans_email/ident_support/email';

protected $_inlineTranslation;
protected $_transportBuilder;
protected $_scopeConfig;
protected $_logLoggerInterface;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
    \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Psr\Log\LoggerInterface $loggerInterface,
    array $data = []

    )
{
    $this->_inlineTranslation = $inlineTranslation;
    $this->_transportBuilder = $transportBuilder;
    $this->_scopeConfig = $scopeConfig;
    $this->_logLoggerInterface = $loggerInterface;
    $this->messageManager = $context->getMessageManager();

    parent::__construct($context);

}

public function execute()
{
    $post = $this->getRequest()->getPost();
    try
    {
        // Send Mail
        $this->_inlineTranslation->suspend();
        $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;

        $sender = [
            'name' => $post['name'],
            'email' => $post['email']
        ];

        $sentToEmail = $this->_scopeConfig ->getValue('trans_email/ident_general/email',\Magento\Store\Model\ScopeInterface::SCOPE_STORE);

        $sentToName = $this->_scopeConfig ->getValue('trans_email/ident_general/name',\Magento\Store\Model\ScopeInterface::SCOPE_STORE);

        $transport = $this->_transportBuilder
        ->setTemplateIdentifier('customemail_email_template')
        ->setTemplateOptions(
            [
                'area' => 'frontend',
                'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
            ]
            )
            ->setTemplateVars([
                'name'  => $post['name'],
                'email'  => $post['email']
            ])
            ->setFrom($sender)
            ->addTo($sentToEmail,$sentToName)
            //->addTo('owner@example.com','owner')
            ->getTransport();

            $transport->sendMessage();

            $this->_inlineTranslation->resume();
            $this->messageManager->addSuccess('Email sent successfully');
            $this->_redirect('');

    } catch(\Exception $e){
        $this->messageManager->addError($e->getMessage());
        $this->_logLoggerInterface->debug($e->getMessage());
        exit;
    }

}
}

when i am sending mail to admin Invalid sender data is coming


texts:
In system and widget xml file of custom module I use source_model tag. First I used this:

<source_model>modulename/system_requesttype</source_model>

but then there was conflict with another extension because modulename was the same. After that I changed it to this:

<source_model>Company_Modulename_Model_System_Requesttype</source_model>

I am wondering if there is any downside of using the second one or if there can be be any problems with Magento compilation?


texts: Magento 2.3.2 blank page after cache:clean

texts: I ran the command 'php bin/magento cache:clean', after this my website frontend showing a blank page. How can I debug this?


texts: Magento 2: Has anyone been able to successfully use Paypal payments pro on Magento 2?

texts:
I have a client that has been using paypal payments pro for magento 1 for a long time. It finally came time to upgrade platforms to magento 2and after building out the website and migrating all the data I'm unable to get payment pro worked. At all. There's not really any errors either, all that happens is when you try to checkout with a credit card is a message pops up saying "Error occurred on the server. Please try again". Nothing in the logs, either. Just that.

I was wondering if anyone out there was actually able to make this solution work.


texts: How do I obtain the value of an order (cart) without taxes, shipping order and voucher discounts?

texts:
I am trying to develop a module that calculates the value of a parameter and shows it in a page. (I am 95% sure that I need the value that is shown by default in cart subtotal at the cart checkout)
How can I obtain that value and calculate it in a controller? (How do I obtain the value of the tax, shipping order and the voucher discount, cart subtotal). Are there differences between where the parameters are saved in the database based on the extensions that the user had installed?


texts: Magento 2.3.6 Commerce : Missing field used into WHERE clause on catalog_product_entity_media_gallery_value_to_entity (entity_id)

texts:
On the category page I have this error :
2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity.entity_id' in 'where clause', query was: SELECT `main`.`value_id`, `main`.`value` AS `file`, `main`.`media_type`, `entity`.`row_id`, IFNULL(`value`.`label`, `default_value`.`label`) AS `label`, IFNULL(`value`.`position`, `default_value`.`position`) AS `position`, IFNULL(`value`.`disabled`, `default_value`.`disabled`) AS `disabled`, `default_value`.`label` AS `label_default`, `default_value`.`position` AS `position_default`, `default_value`.`disabled` AS `disabled_default`, IFNULL(`value_video`.`provider`, `default_value_video`.`provider`) AS `video_provider`, IFNULL(`value_video`.`url`, `default_value_video`.`url`) AS `video_url`, IFNULL(`value_video`.`title`, `default_value_video`.`title`) AS `video_title`, IFNULL(`value_video`.`description`, `default_value_video`.`description`) AS `video_description`, IFNULL(`value_video`.`metadata`, `default_value_video`.`metadata`) AS `video_metadata`, `default_value_video`.`provider` AS `video_provider_default`, `default_value_video`.`url` AS `video_url_default`, `default_value_video`.`title` AS `video_title_default`, `default_value_video`.`description` AS `video_description_default`, `default_value_video`.`metadata` AS `video_metadata_default` FROM `catalog_product_entity_media_gallery` AS `main`
 INNER JOIN `catalog_product_entity_media_gallery_value_to_entity` AS `entity` ON main.value_id = entity.value_id
 LEFT JOIN `catalog_product_entity_media_gallery_value` AS `value` ON main.value_id = value.value_id AND value.store_id = 1 AND value.row_id = entity.row_id
 LEFT JOIN `catalog_product_entity_media_gallery_value` AS `default_value` ON main.value_id = default_value.value_id AND default_value.store_id = 0 AND default_value.row_id = entity.row_id
 LEFT JOIN `catalog_product_entity_media_gallery_value_video` AS `value_video` ON value.value_id = value_video.value_id AND value.store_id = value_video.store_id
 LEFT JOIN `catalog_product_entity_media_gallery_value_video` AS `default_value_video` ON default_value.value_id = default_value_video.value_id AND default_value.store_id = default_value_video.store_id WHERE (main.attribute_id = '90') AND (main.disabled = 0) AND (entity.entity_id in ('1')) ORDER BY IF(value.position IS NULL, default_value.position, value.position) ASC

The table catalog_product_entity_media_gallery_value_to_entity has no field entity_id but a row_id

Any idea why the instance is calling a query with the (entity.entity_id in ('1')) is used into the where clause ?
Thanks


texts: Showing Salable QTY in frontend Magento 2.3

texts:
We are currently showing our available qty in stock on the frontend of each product using the following code:

<?php
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
    $qty = $StockState->getStockQty($_product->getId());
?>

But when we enable the new MSI feature in Magento 2 the above code always outputs 0. How are we able to show the total salable qty in the frontend of all inventory sources?

Edit:

I found out that when I enable the Default source and assign it to a product and give it for example 10pcs. The above code outputs 10, so the above code doesnt take all the inventory sources into count. It should show the total salable qty like its showing in the backend.

Edit 2:

Explanation with images.

With the above settings the above code outputs 10. It should output 25.

When Default Source is unassigned the above code outputs 0. It should output 15.


texts: how to Send sms to customer mobile if ordered placed via Magento admin panel

texts: i was already done sms integration if the order placed by customer using my website.  But i want to send sms to customer mobile number if order placed by admin (site owner) using magento admin panel. In magento admin panel has option to place order for the customer.


texts: Magento 2 non-category links not displaying

texts:
I'm trying to add non category links to the top nav using the following code. It displays "Test page" & "Test page3" but not "Test page2". So I'm assuming that there is something wrong with the code as it display the first and last. Any ideas?

<?php
namespace atharna\navUpdate\Observer;
use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Data\Tree\Node;
use Magento\Framework\Event\ObserverInterface;
class Topmenu implements ObserverInterface
 {

/**
 * @param EventObserver $observer
 * @return $this
 */
public function execute(EventObserver $observer)
{
   /** @var \Magento\Framework\Data\Tree\Node $menu */
   $menu = $observer->getMenu();
   $tree = $menu->getTree();
   $data = [
       'name'      => __('Test page'),
       'id'        => 'test-page',
       'url'       => 'test-page',
   ];
   $node = new Node($data, 'id', $tree, $menu);
   $menu->addChild($node);
   $data = [
       'name'      => __('Test page2'),
       'id'        => 'test-page2',
       'url'       => 'test-page2',
   ];
   $node = new Node($data, 'id2', $tree, $menu);
   $menu->addChild($node);
   $data = [
        'name'      => __('Test page3'),
        'id'        => 'test-page3',
        'url'       => 'test-page3',
   ];
   $node = new Node($data, 'id3', $tree, $menu);
   $menu->addChild($node);
   return $this;
}

}

?>


texts: Override customer method in magento issue?

texts:
So this is my modules/Namespace_Module.xml content:

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Module>
            <active>true</active>
            <codepool>local</codepool>
        </Namespace_Module>
    </modules>
</config>

This is the namespace/module/etc/config.xml content:

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Module>
            <version>0.2.0</version>
        </Namespace_Module>
    </modules>
    <frontend>
        <routers>
            <customer>
                <args>
                    <modules>
                        <namespace_module before="Mage_Customer_AccountController">Namespace_Module_Frontend_Customer</namespace_module >
                    </modules>
                </args>
            </customer>
        </routers>
    </frontend>
</config>

and this is the namespace/module/controllers/Frontend/Customer/AccountController.php content:

<?php
require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';
class Namespace_Module_Frontend_Customer_AccountController extends Mage_Customer_AccountController
{
    public function indexAction()
    {
        parent::indexAction();
    }
    public function editPostAction()
    {
        echo 1; exit();
    }
}

What I want to achieve when I update the my account inputs, when i click on the update button to show me the echo 1; exit(); At the moment nothing happens. What am I missing ? thx


texts: How to migrate magento1 orders from 1 database to another

texts:
I have 2 databases 1 old & 1 new. How to migrate orders from new db to old database?

The reason is some how my products got deleted so I restore 1 day old database.


texts: Configurable Product Missing After Reindexing

texts: I have imported products using data migration tool from M1 to M2. But some products does not show on frontend. When I save the product manually it appears on frontend but after reindexing it again vanishes. I am not getting what could be the reason for the same.


texts: Product pages generate 500 Server Error but store is otherwise fine

texts:
I have a situation where Magento seems to work generally, but throws 500 Internal Server Errors on product pages only.

I have a working Magento (1.8 CE) store that needs to be copied to a second server.  I started with a clean server build, then copied the working Magento installation via rsync (preserving permissions).  The servers share a database, Redis cache, and /var and /media directories.

The secondary installation almost works - I can browse store categories, search for products, log into the admin area, etc., however single product pages don't load correctly.  Firebug shows the main request for the product is generating a 500 Internal Server Error.  The page renders correct navigation, product images, SKU and pricing, but stops at the description and doesn't render the footer.

The new server passes the Magento server readiness check script.  From what I can tell, the permissions are identical to the working server and match the recommended Magento permissions. Since both servers share a database, all the internal settings are the same.  Magento logging is on, and I have both "ini_set('log_errors', 1)" and "error_reporting(E_ALL)" in index.php, but there is no more detail in any of the logs.

Not sure where to go from here!


texts: Placeholder Image not showing in frontend

texts:
I was using cdn for media intially but then later replaced it to pub/media/. I dont have any product images with me, hence I uploaded placeholder images from admin. The products still load from pub/media/catalog/product/cache folder. This is what I have done till now:

Gave 777 permission and even changed the user for all files
Flushed image cache folder from admin, also deleted pub/media/catalog/product/cache folder manually
Ran bin/magento catalog:images:resize but got error that original image not found
Ran setup upgrades, di compile, static content deploy, deleted generated, pub/static/ ,var/cache folders
Disabled custom theme and all custom modules

The placeholder images show in admin but not on frontend. And debugging further I realised that placeholder images show for products which have no image assigned, but do not show for products which already had an image assigned but that image is no longer found. I get 404 error when I open those cache links, ideally it should show the placeholder image


texts: Magento Calculating Incorrect Fixed Discount

texts:
Magento does not seem to be correctly calculating the order discount.  I have a rule setup to give $10 an order between $50 and $75.

But this is what happens when there are multiple items in the cart:

What could be causing this?


texts: Import orders from Magento 1 to Magento 2 live website

texts:
I have a Magento 2 shop in live and another shop in Magento 1. I'm preparing the migration of Magento 1 shop to Magento 2 in another website, so I will have 2 websites in Magento 2. How can I migrate the orders of Magento 1 shop to Magento 2? If I use the Data Migration Tool of Magento the orders save with website id 1 and I need to be save as website id 2.
Thanks


texts: MySQL core_config_data entries matching (Regex)

texts:
Magento 2 makes it hard for me to handle configuration settings for system_config area.
Since I have not received any answers there yet, I need to try something else to solve the issue.

(Assuming I don't get any answers there):
As explained in the other question, I have around 1500 settings (ALOT from a 3rd party theme) settings that are in the config.php file, and not importable into database when using app:config:dump.

I want to find the unique entries for specific sections and import them into the new database so that I can have values for the theme, EDITABLE in the backend!  Keep in mind the users that will use the backend would not know how to edit the file config.php correctly.
I have now exported the core_config_data entries that exist in a source database and a new M2.3.5 installation database.
So, entries around 1700 in the one, and around 50 in the other.
I am using C# to parse the SQL export files, but I need assistance with a non-greedy regex solution.
Splitting just with C# proves hard, because I can't really use the , character, see example entries below:  (the state_required entry has multiple states).
The idea is to extract each row's path entry (they are already split into individual row entries) and compare between the database to see if they exist or not (as mentioned I will try to import mostly the custom theme entries).
('default',0,'web/seo/use_rewrites','1','2019-12-10 10:47:26.0')
('default',0,'general/region/display_all','1','2019-12-10 10:47:26.0')('default',0,'general/region/state_required','AU,CA,CH,CN,CO,EE,ES,LT,LV,MX,PL,RO,US','2020-09-30 20:41:40.0')
('default',0,'catalog/category/root_id',NULL,'2019-12-10 10:47:26.0')

Currently : I have several attempts to extracting the path, but most attempts are 'greedy' and select more text than needed.
The most accurate one:
Issue is not all my entries are ~ 'default',0
'default',0,(?<path_entry>.+?)'

A more generic attempt that captures seperate entities: - needs improvement.
'(?<path_entry>.+?)'

How can I select the above SQL entries to get the path entry reliably?
I want the following as a result set extracting it from the SQL so that I can compare them between the MySQL databases:
web/seo/use_rewrites
general/region/display_all
catalog/category/root_id


texts: Administrator configuration menu limited. Can't uncheck "Use system value" case

texts:
I just updated magento to version 2.1.4 and this type of bug show off right after the update. (cf. screen)

This error happens on every "Store View" form.

Can you help me ?


texts:
I try install fresh magento 2.4 but always available setup wizard but currently I not see setup wizard in this version.
https://prnt.sc/u8eeoi
How to install magento 2.4 ?


texts:
<reference name="content">
    <block type="cms/widget_page_link" name="48fc761f38fa9838fcc3a3b498c47f72" template="cms/widget/link/link_block.phtml">
        <action method="setData">
            <name>anchor_text</name>
            <value>asdfasdfsad</value>
        </action>
        <action method="setData">
            <name>title</name>
            <value>asdfasdfasdfasd</value>
        </action>
        <action method="setData">
            <name>page_id</name>
            <value>2</value>
        </action>
    </block>
</reference>```


texts: Is there any ways to use same image for more products ?


texts: Checkout shipping methods display default when only country is defined

texts:
I defined a table rates like that:

ESP,*,*,1.0000,0.0000
ESP,Ceuta,*,1.0000,15.0000
ESP,Ceuta,*,2.0000,20.0000
...

The functionality is working correctly. But I don't like the user experience on checkout, because the default country is Spain but nothing else is filled, so on the shipping methods displays no method. Then when the user fills the form, it finally displays a shipping method depends on what region/zip code especified.

I want, by default, display the 0€ shipping method, because it's selected Spain. Then if the user chooses Ceuta it will display the 15€.

Is it possible to do that?

PS: I tried to trigger the estimate-shipping-methods JS function, on the change event for country dropdown... but I did not know how to do it, and neither know if it would work.

Tried to do something like that:

require([
    'jquery',
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/model/shipping-rate-registry',
    'Magento_Checkout/js/model/shipping-rate-processor/new-address'
], function($, quote, rateRegistry, newAddressProcessor) {
    var address = quote.shippingAddress();
    console.log('address', address);
    rateRegistry.set(address.getCacheKey(), null);
    newAddressProcessor.getRates(address);
});


texts: How I can determine if the page is checkout/cart?

texts:
I have something but this checks if in the cart are products:

  public function customerLogin(Varien_Event_Observer $observer)
   {
           if (Mage::helper('customerredirect')->isEnabled() && !Mage::getSingleton("core/session")->getRedirectregister()){
               $lasturl = Mage::getSingleton('core/session')->getLastUrl();
             if (strpos(Mage::helper('core/http')->getHttpReferer(), 'checkout/cart') === false){
                 if (! preg_match("#customer/account/create#", $lasturl) && Mage::helper('customerredirect')->isoptionEnabled('login_customerredirect')) {
                          if($this->_CustomerGroup()) {
                           $_session = $this->_getSession();
                           $_session->setBeforeAuthUrl(Mage::helper('customerredirect')->setRedirectOnLogin());
                         }
                }
            }
         }
        Mage::getSingleton("core/session")->setRedirectregister(false);
   }

and I add this in the /app/design/frontend/base/default/template/checkout/onepage/link.phtml

<?php if ($this->isPossibleOnepageCheckout() && Mage::getSingleton('customer/session')->isLoggedIn()):?>
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Proceed to Checkout')) ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><?php echo $this->__('Proceed to Checkout') ?></button>
<?php else: ?>
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Proceed to Checkout')) ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo Mage::getUrl('customer/account/login'); ?>';"><?php echo $this->__('Proceed to Checkout') ?></button>
<?php endif?>

All I want to do is when I press on the Proceed to Checkout if the user is not login to be redirected to login and the autoredirect to checkout onepage.

After more searches i found something that need to be put in the onepage checkout:

      if (!$this->helper('customer')->isLoggedIn()) {
             header("Location: /customer/account/login/");
             exit();
      }

but this is generally how I can implement this for my needs?

Edit: Maybe this can be a solution?
https://magento.stackexchange.com/a/64085/22840
Thank you


texts: Countdown Timer is not working in magento 2.1.7?

texts:
i am use date picker in system config and get date in this format 2015-07-15
i want to convert it into this format 2015-07-15 17:29:31 because Jquery countdown is not work if i insert static value in 2015-07-15 17:29:31this format then it will work. i have two date

1) countdown start date

2) countdown end date

i am use  jquery.countdownTimer.js

below is my count down script


texts: Magento SOAP v1 API adds a 2nd broken image after successfully adding a real image

texts:
I am adding a new Product using the API, I am then running the function below to add an Image to the newly created product.

The problem is, when I view the newly created product, it has 1 valid image that was uploaded and then 1 broken image.  It seems like it always makes 2 image records in the Admin panel even though only 1 image is uploaded.

I have tested this on multiple Magento installs and the problem persist everywhere.  I am at a lost as to what to do next.

View this image to see the result after adding 1 image through the API, you can see it makes 2 entries (1 good one and 1 bad one)...

You can see in the image that the broken image is selected as the default.  I cannot figure out why this broken image is even being created instead of my uploaded image being used.

Below is the Image API code I am using.

function uploadImage( $sku, $imagePath, $productId ) {
    global $proxy;
    global $sessionId;

    $sku = strtoupper($sku );
    $newImage = array(
        'file' => array(
            'name' => 'file_name',
            'content' => base64_encode(file_get_contents($imagePath)),
            'mime'    => 'image/png'
        ),
        'label'    => "Item:" . $sku,
        'position' => 0,
        'types'    => array('image', 'small_image', 'thumbnail', 'ebayimage' ),
        'exclude'  => 0
    );
    try {
        $imageFilename = $proxy->call(
            $sessionId,
            'catalog_product_attribute_media.create',
            array(
                $productId,
                $newImage
            )
        );
        echo '<br>Image Filename Added '.$imageFilename;
        //var_dump($proxy->call($sessionId, 'product_media.list', $sku));
    }
    catch(Exception $e) {
        print( "Error assigning image to $sku: " . $e->getMessage() . "\n" );
    }
}

And here is my Product creating code which then calls the Image function above...

try {
    // Create new product
    $productId = $proxy->call(
        $sessionId,
        'product.create',
        array(
            'simple',
            $attributeSet,
            $productSku,
            $productData
        )
    );
    echo 'Product ID Create: '.$productId;

    // Upload and attach Image
    $imagePath = 'twitter-header.png';
    uploadImage( $productSku, $imagePath, $productId );

} catch (SoapFault $e) {
    echo "Product creation error $e";
}

Any ideas why it would be creating this dummy broken image record everytime it creates a valid record?

UPDATE
I was starting to think that possibly another extension on the magento site I am working on might be the cause but I have now tried my code on a brand new fresh Magento Install and the issue still exist.  For every Image that I create through the API, it then creates an additional broken image with the original image name with _1 added to the end of the filename.

I cannot figure out why this is happening, surely such a huuuuuge bug wouldn't have lived in Magento this long?

Here is the result of the API call...You can see 2 image records for each Image added.  The 2nd is the broken image and it is assigned the thumbnail, small_image, and image values


texts:
I am using Paypal Express Checkout payment gateway. When you checkout using express checkout, it will redirect to paypal page. On the top left I need to display my store logo instead of text.

So far I have figured out that the API used is SetExpressCheckout API Operation (NVP)

In this there is a field named HDRIMG which sets the logo. In core_config_data table this can be seen with path paypal/style/paypal_hdrimg. If the logo URL is set from DB then it shows the logo on paypal page, but I need to set it from

public function start($returnUrl, $cancelUrl)

located at

app/code/core/Mage/Paypal/Model/Express/Checkout.php

Any help is appreciated.

Thanks !!


texts:
for orders paid by credit card I have the name of the payment that appears in the block 'payment information' but orders with a custom-paying mode I just have this 'Order Placed WAS using EUR'

I don't find how add this information.


texts: I do not see the columns added through the Join in my grid

texts:
I need show the column in my custom grid in magento 2.1.7

If I get the query that is generated after the join, this information.

Thanks for your help.


texts:
I am new to magento 2.I want to use custom header and footer design for my site but don't where to keep that code. I am using blank theme. Please help me.
Thanks in advance.


texts: Magento 2 REST API: Custom API with customer_token expecting string[] instead of string

texts:
I made an API which returns wishlist of a user using customer_token as authentication, obtained via this API:

  rest/V1/integration/customer/token

My webapi.xml looks something like:

        <?xml version="1.0"?>
    <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
     <route url="/V1/fetch_wishlist/" method="GET">
            <service class="Vendor\WishlistApi\Api\WishlistInterface" method="setData"/>
            <resources>
                <resource ref="self" />
            </resources>
            <data>
                <parameter name="customerId" force="true">%customer_id%</parameter>
            </data>
        </route>
    </routes>

But I am getting an error as:

{
"message": "Invalid type for value: \"string\". Expected Type: \"string[]\".",
"trace": null
}

Rest of my code is correct, I used this API with anonymous resource in webapi.xml and it works fine if i send the payload as:

{"customerId": [3500]}

However I get the same exact error if I put the payload as:

{"customerId": 3500}

Any suggestions?


texts: Unrecognized method 'isLoaded()' in Magento 2

texts:
I'm trying to join product and my custom table but it's returning error

  Unrecognized method 'isLoaded()'

my code is:

 /**
 * @param \Magento\Backend\Block\Template\Context $context
 * @param \Magento\Backend\Helper\Data $backendHelper
 * @param \Learning\Helloworld\Model\ResourceModel\Subscriber\CollectionFactory $collectionFactory
 * @param \Learning\Helloworld\Model\Status $status
 * @param \Magento\Framework\App\ResourceConnection $resource
 * @param \Psr\Log\LoggerInterface $loggerInterface
 * @param ProductFactory $productFactory
 * @param array $data
 */
public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    \Magento\Backend\Helper\Data $backendHelper,
    \Learning\Helloworld\Model\ResourceModel\Subscriber\CollectionFactory $collectionFactory,
    \Learning\Helloworld\Model\Status $status,
    \Magento\Framework\App\ResourceConnection $resource,
    \Psr\Log\LoggerInterface $loggerInterface,
    \Magento\Catalog\Model\ProductFactory $productFactory,
    array $data = []
) {
    $this->_status = $status;
    $this->_collectionFactory = $collectionFactory;
    $this->_productFactory = $productFactory;
    $this->_resource = $resource;
    $this->_log = $loggerInterface;
    parent::__construct($context, $backendHelper, $data);
}

/**
     * Prepare grid collection object
     *
     * @return $this
     */
    protected function _prepareCollection()
    {
        $collection = $this->_collectionFactory->create();

        $productCollection =  $this->_productFactory->create()->getCollection();
        $select = $productCollection->getSelect();
        $tempCollection = $collection->getSelect();

        $temp =  $tempCollection->join(
            array('product' => $this->_resource->getTableName('catalog_product_entity')),
            'main_table.product_id = product.entity_id'
         );

        $this->_log->debug((string)$temp);

        $this->setCollection($temp);

        return parent::_prepareCollection();
    }

When I debug the sql query it's returning

SELECT `main_table`.*, `product`.* FROM `custom_info` AS `main_table`
 INNER JOIN `catalog_product_entity` AS `product` ON main_table.product_id = product.entity_id

and it's returning result also but still i'm getting isLoaded() Error?

Could you please let me know if my query wrong?


texts: Cannot use jquery or custom plugins without breaking this script

texts:
I have the script below, which allows tabs in the navigation bar to be drop down in Magento Go. However, when I uploaded jquery to prepare for uploading additional plugins, the custom plugin I uploaded works, but the tab script ceases working once the basic jquery script is uploaded (i.e. jquery-1.10.2.js). When I remove jquery-1.10.2.js, it works again, but I cannot use any other custom script unless I allow jquery-1.10.2.js to be active. I tried all test cases, including changing the loading orders, and that's the conclusion I came to.

Here's the script that works on its own, but stops working once jquery-1.10.2.js or any older version of it is added:

Enterprise.Tabs = Class.create();
Object.extend(Enterprise.Tabs.prototype, {
    initialize: function (container) {
        this.container = $(container);
        this.tabs = this.container.select('dt.tab');
        this.activeTab = this.tabs.first();
        this.tabs.first().addClassName('first');
        this.tabs.last().addClassName('last');

        this.container.setStyle({visibility: 'visible'});
        this.onTabClick = this.handleTabClick.bindAsEventListener(this);
        for (var i = 0, l = this.tabs.length; i < l; i ++) {
            this.tabs[i].observe('click', this.onTabClick);
        }
        this.select();
    },
    handleTabClick: function (evt) {
        this.activeTab = Event.findElement(evt, 'dt');
        this.select();
    },
    select: function () {
        for (var i = 0, l = this.tabs.length; i < l; i ++) {
            if (this.tabs[i] == this.activeTab) {
                this.tabs[i].addClassName('active');
                this.tabs[i].style.zIndex = this.tabs.length + 2;
                /*this.tabs[i].next('dd').show();*/
                new Effect.Appear (this.tabs[i].next('dd'), { duration:0.5 });
                this.tabs[i].parentNode.style.height=this.tabs[i].next('dd').getHeight() + 15 + 'px';
            } else {
                this.tabs[i].removeClassName('active');
                this.tabs[i].style.zIndex = this.tabs.length + 1 - i;
                this.tabs[i].next('dd').hide();
            }
        }
    }
});


texts: How to allow same SKU for different products?

texts:
I need add same SKU for different product.

Example:SKU xyz-1 will be common for product_1, Product_2, and product_3


texts: Magento 2.1 not displaying out of stock items for configurable items

texts:
I have my store where I created multiple configurable products all with a custom attribute Color and a custom attribue Size.
In the configuration the 'Display out of Stock Products' is set to yes. For simple products, it is correctly showing the products as out of stock. However for configurable items, I do not see the colors and sizes that are not in stock.
For example, for https://dev.skadi-outdoor.com/montane-configurable-test.html, I have also a product in S(mall) and XL(Extra Large), but those swatches are not showing.
Don't know what I'm doing wrong? Any related post on this topic that I can find is about the other way around, where people do not want to show these unavailable configured items...
(UPDATE) I created now also another configurable product with only 1 attribute Size (to exclude that it has to do something with having multiple attributes). This product (https://dev.skadi-outdoor.com/test-omm.html) has 6 sizes, 3 with stock and 3 without, but only the ones with stock are showing ???


texts:
How add a condition rule fieldset  in admin custom in magento 2

like this


texts: Add Custom Attribute to Category to Select a CMS Page

texts: I'd like to be able to choose a CMS page with a custom attribute on a category. I know how to add a custom attribute to a category and have it be a select box, but is it possible to have the select populated with a list of CMS pages?


texts: How to add digits range validation rule to the input field inside the UI-form?


texts: JS event on configurable product frontend

texts:
I am working on the configurable product view page.

I want to add an event to check if all options are checked before an AJAX call.

I tried a solution like this to override the widget Magento_Swatches/js/SwatchRenderer, but failed. When I clicked or I chose an option, it didn't execute my custom function.

Do you have some advise for my problem and how should i do it?

Did I forgot something?


texts: Create beautiful image upload in configuration magento 2

texts:
add image in create new product

How to make an similar image upload in configuration instead of

In add product, it uses phtml file. In configuration, it uses xml file.


texts: Magento 2: How to display all Customer Group Price on Product Detail Page

texts:
I would like to display all customer group price for that product on product detail page.

May be need to work on vendor\magento\module-catalog\view\base\templates\product\price\final_price.phtml

So when user is not logged in they are able to see for this Group we have this prices.

$productId = $block->getSaleableItem()->getId();

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$ProductObject = $objectManager->create('Magento\Catalog\Model\Product')->load($productId);

$groupPrices = $ProductObject->getData('group_price');

echo "<pre>";
print_r($groupPrices);
exit;

After that, need to set Customer Group wise Promotion Price, then also display that.


texts: How to auto import products into store from supplier XML feed using Magmi?

texts: There is a company called techdata that provides a product URL, DTD's, and some other stuff. I'm a novice so I don't really know what any of that means but I have to somehow use that to import their products into my Magento Store. I have Magmi (the understandinge version) installed on my store because I know it's useful when importing a lot of products. Tech data provides a user manual but I don't understand most of it. You can take a look if u want, here. I know it's a lot to take in but any help is greatly appreciated. I posted this before but I didn't mention Magmi at all and most of the responses I got, I didn't really understand.


texts: Is it possible to update table when module disable or delete?

texts:
I have created custom module which replicates Shopping cart price Rule module.
Used flag to filter core shopping cart price grid as well as my custom module grid.

I can able to create add my custom shopping price rule which i will use for my later purpose. I will use 'salesrule_validator_process' observer to stop this rule.

Now when i delete/disable module from magento admin or module config.xml to false my custom created shopping rule has been applied to shopping cart in front end cart page.

Kindly advice on this situation to update salerule table when my custom module disabled or deleted ?


texts: Intuitively show in frontend that address is too long

texts:
I am already using the Magento form validation, but I would like to let customers know exactly which part and by how much is the string too long.

Is it possible to implement a character counter next to the input field?

I know it could be updated by something like:

$('street_1').on('keyup', function(e){

  });

But I am not very familiar with frontend/design programming.

If there are some other solutions to this already, I would love hear them.


texts: Send image in transactional emails using var

texts:
I'm getting the image url in transactional emails using

Url : 	{{var image_url}}

But I'm not able to show image in the email when I'm using it as

Image:

Image format mentioned above is not correct for emails? It shows nothing against Image in email.


texts: Magento 2.1.5: Product Widget for Homepage - Not Working

texts:
I am facing the following issue when creating a condition to show products on the homepage using the widgets in the content manager. I am running 2.1.5 and have manually checked the files for which there was a similar issue occurring for previous version (see file locations below). All three files are up-to-date with the fix but I am still facing this issue in Magento 2.1.5.

FYI, I have also done reindexing, clean and flushed the cache, as well as static content deploy.

  Error filtering template: SQLSTATE[42S22]: Column not found: 1054
  Unknown column 'e.b_homepage' in 'where clause'

Query was:

SELECT COUNT(DISTINCT e.entity_id)
FROM
    `catalog_product_flat_1` AS `e`
    INNER JOIN `catalog_category_product_index` AS `cat_index`
    ON
            cat_index.product_id=e.entity_id
        AND     cat_index.store_id='1'
        AND     cat_index.visibility IN(2, 4)
        AND     cat_index.category_id='2'
    INNER JOIN
        `catalog_product_index_price` AS `price_index`
    ON
        price_index.entity_id = e.entity_id
        AND price_index.website_id = '1'
        AND price_index.customer_group_id = 0
WHERE (((IFNULL(`e`.`entity_id`, 0) IN (SELECT `catalog_category_product`.`product_id` FROM `catalog_category_product` WHERE (category_id IN ('42')))) AND(IFNULL(`e`.`b_homepage`, 0) = '1') ))

  /vendor/magento/module-catalog-widget/Model/Rule/Condition Combine.php

  Product.php

  /vendor/magento/module-catalog-widget/Test/Unit/Model/Rule/Condition
  CombineTest.php


texts: Magento2 Adding product attribute option via API

texts:
I am adding new colors to the colors attribute via API. This works fine, but I want to send all my options in 1 request. Now I have to do multiple POST request to rest/V1/products/attributes/color/options

This is my code

protected $resourcePath = 'rest/V1/products/attributes';

foreach($options as $option) {
$optionData = [];

$optionData = [
    AttributeOptionInterface::LABEL => $option,
    AttributeOptionInterface::SORT_ORDER => 100,
    AttributeOptionInterface::IS_DEFAULT => false,
    AttributeOptionInterface::STORE_LABELS => [
        [
            AttributeOptionLabelInterface::LABEL => $option,
            AttributeOptionLabelInterface::STORE_ID => 1,
        ],
    ],
];

    $this->addColorAttribute($optionData);
}

public function addColorAttribute($optionData)
{
    $attributeCode = 'color';

    $serviceInfo = [
        'rest' => [
            'resourcePath' => $this->resourcePath . '/' . $attributeCode .'/options',
            'httpMethod' => Request::HTTP_METHOD_POST,
        ]
    ];

    return $this->client->request($serviceInfo,
        [
            'attributeCode' => $attributeCode,
            'option' => $optionData,
        ]
    );
}

How could I send all my $optionData to the API in 1 request so all the options are addded to the product attribute color ?


texts: Magento 2 custom shipping method hide/show on basis of city

texts:
I want to show/hide custom shipping method like "Delivery in 2 hours" radio button if customer fills particular city on checkout page. If he is from that city will show "2 hour delivery" option if not will hide it.
Can anybody help me in this?

Thanks in advance.


texts:
I have tried 2 kind of solutions

  //First kind----------------------------------

$addresss = $objectManager->get('\Magento\Customer\Model\AddressFactory');
$address = $addresss->create();

$address->setCustomerId($customer->getId())
->setFirstname('vinoth')
->setLastname('kumar')
->setCountryId('IN')
//->setRegionId('1') //state/province, only needed if the country is USA
->setPostcode('31000')
->setCity('Osijek')
->setTelephone('0038511223344')
->setFax('0038511223355')
->setCompany('GMI')
->setStreet('Kersov')
->setIsDefaultBilling('1')
->setIsDefaultShipping('0')
->setSaveInAddressBook('1');
try{
$address->save(); echo'asdasd'; exit; //Not saving data. Refreshes the page. Not printing the echo.
}

  // Second kind ---------------------------------------

public function __construct(
        \Magento\Directory\Model\Region $region
        \Magento\Customer\Api\Data\AddressInterfaceFactory $addressDataFactory,
        \Magento\Customer\Api\AddressRepositoryInterface $addressRepositoryInt
    ) {
        $this->_region = $region;
        $this->_addressDataFactory = $addressDataFactory;
        $this->_addressRepository = $addressRepositoryInt;
    }

    public function updateAddress($custId){ echo $custId;
        $directory = $this->_region->create();
        $addressIntFct = $this->_addressDataFactory->create();

            $addressIntFct->setCustomerId('id here')
            ->setFirstname('firstName')
            ->setLastname('lastName')
            ->setCountryId('US')
            ->setPostcode(98089)
            ->setCity('city')
            ->setTelephone('999999999')
            ->setFax('999999999')
            ->setCompany('company')
            ->setStreet('street')
            ->setRegionId('region id here')
            ->setIsDefaultBilling(1)
            ->setIsDefaultShipping(0);
            ->setSaveInAddressBook('1');
            try{
                $this->_addressRepository->save($addressIntFct); echo'asdasd'; exit; //Not saving data. Refreshes the page. Not printing the echo.
            }catch (Exception $e) {
                Zend_Debug::dump($e->getMessage());
            }
    }

No exception or errors are in log file.

Any idea why its not working?


texts: Catalog URL Rewrite after daily import/update of Product

texts:
We have a scenario where we import/update products (about 12K of them) on daily basis, everything is working fine with the imports. We have different store-views (languages) in a shop.

But when the products  are loaded in front-end most of the time taken is during router_match, which is a show-stopper and the details page is very slow, which is unacceptable. We found that when the products are imported/updated a permanent-redirects are created with appended url like shoes-1.html. And resolving the actual URL is taking a lots of time.

I found few ways to truncate core_url_rewrite table and re-run reindexer. But as I look further and found that this is NOT recommended on Production. Can somebody please point out why, perhaps because of some links being shared across other sites or may be Google indexed pages. But if I don't care for these (our shop is a closed site - Only registered user are allowed). Will this have any other impacts.

Also is there any way to fix this - "nicely", even for open shops?


texts: Integrating Microsoft Calirty Tracking Code Into Magentos2.3.5 CMS?

texts:
Hi does anyone know where I can put the Clarity Tracking Code in Magentos website? Here are the steps listed below. We have the first step completed setting up the Clarity account.  But not sure about step 3.
Step 2: Go to 'Setup' and copy the Clarity tracking code.
Step 3 - Paste it into the  section of your website. For this you need to check where to put Clarity tracking code in Magento CMS.
Yea, I am not sure where to put this tracking code in the CMS of Magento.  It does not give me directions for Magento setup, see image and tracking code below. So can this work with Magento?
I know Microsoft Clarity is a new Tracking Tool like google analytics. We have google analytics set up already. However, this tool does not make it very clear how to set up with Magneto's CMS.
https://clarity.microsoft.com/
<script type="text/javascript">
    (function(c,l,a,r,i,t,y){
        c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
        t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
        y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
    })(window, document, "clarity", "script", "");
</script>

Thanks for any help!


texts: In localhost extension Install giving error in magento 2.2.5

texts:
How to solve this error.

I'm running magento 2.2.5 in my localhost in Ubuntu. I want to install extension, but unable to install due to this error. I gave full permission as 777 to my folder. But still error showing.

I'm little confuse on it how to solve. Please help. Waste my all day, but unable to solve.


texts:
Report -> Product -> Ordered

I want to add new column Brand (f_brand) in report grid.

I am unable to find any Grid.php or something like this file.

Can anyone help me on this? Which file I need to override and how can I add new column in this grid?


texts: Product Images are not showing in Magento

texts:
picture not showing in Magento

How to fix this error ?


texts:
I attempt to call a resourceModel, however, I only recieve a white screen and the following error message within my log:

  Warning: include(Namespace/ProjectName/Model/Mysql4/Projectname.php): failed to open stream: No such file or directory

This is how i'm calling the above:

Mage::getResourceModel('projectname/projectname')->uploadData();

This is how the resourceModel is defined in the config.xml:

<models>
    <projectname>
        <class>Namespace_ProjectName_Model</class>
        <resourceModel>projectname_mysql4</resourceModel>
     </projectname>
....
</model>

And finally, this is the resourceModel itself:

class Cjponyparts_ProjectName_Model_Mysql4_ProjectName extends Mage_Core_Model_Mysql4_Abstract{
    ....
    function uploadData(){....}
}

The resourceModel is located at:

Namespace/ProjectName/Model/Mysql4/ProjectName.php

The only difference I see that could cause this error is that I have the resourceModel defined as like this "ProjectName.php" while it looks for something like this "Projectname.php".  Is this the problem?  How can I fix?  Do resourceModels need to be defined as the second option?


texts:
Is there a way to check if am I on Success page on Magento 2?
I know in Magento 1 we can check and compare the action name, for example. But in Magento 2, there is something similar?


texts: Can you perform Magento UI_Component Validation with value from store config?

texts:
Is it possible to get the minimum text length value from store config system.xml?

<field name="mytext" sortOrder="20" formElement="input">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="source" xsi:type="string">customer</item>
        </item>
    </argument>
    <settings>
        <label translate="true">MyText</label>
        <dataType>text</dataType>
        <dataScope>mytext</dataScope>
        <validation>
            <rule name="required-entry" xsi:type="boolean">true</rule>
            <rule name="min_text_length" xsi:type="number">_____value from store config_____</rule>
        </validation>
    </settings>
</field>


texts: How to Check a catagory is Anchored or non Anchored Programmatically in Magento 2

texts: I want to check whether my current category in Anchored in Magneto 2


texts:
we want to make use of the Magento Open source version. Is there any community extension to handle B2B customers and quotes?
I only want to use Magento as Backend/Admin software without any shop.
Thanks!


texts: Need to get "default_billing" value from window.customerData object in js file magento 2

texts:
How to get default_billing value from window.customerData object in js file magento 2

Thanks.


texts: Infinite loop issue, when qty becomes zero

texts:
I am getting the infinite loop issue in the below scenario :

Added product 1 into the cart.
Added product 2 into the cart.
Make the qty to 0 from the admin-end.
Click on the checkout button and at this point I am getting the infine loop issue.

I have checked and observed that my request is not even reaching the OnepageController index action. So, I am thinking there is some code in any event observer that is resulting in the infinite loop issue.
Also I have observed that there is some custom code to remove the item from cart, if there the minimum qty is not available.

I have checked and infinite loop issue appears on the line

$quote->loadActive($this->getQuoteId());

inside getQuote() function in class Mage_Checkout_Model_Session

loadActive() function inside class Mage_Sales_Model_Quote further calls $this->_afterLoad(); which is creating issue.

How can I track and debug this issue? or if anyone faced any similar issue earlier and has some knowledge to share.


texts: How do I send a parameter to a function from block?

texts:
This is my try:

$this->addTab( $grup_name, array(
                'label'     => Mage::helper('netgroup_attributegrouping')->__($grup_name),
                'title'     => Mage::helper('netgroup_attributegrouping')->__($grup_name),
                'content'   => $this->getLayout()->createBlock('netgroup_attributegrouping/adminhtml_form_edit_tab_managegroup')->toHtml(), //calea catre block
                'url'=> $this->getUrl('*/*/index/' ,array('active_tab' => $grup_name))
));

is it possible that somehow to send a parameter to a a function from a block  using the url attribute from tabs ? Or is the an other way ?


texts:
Magento2 : Create multi select category attribute with custom source.
Can anyone give me with example?


texts:
I recently checked the magento site i am working on. And was presented with this gigantic error message from magento.

https://pastebin.com/Y0hGEx1m

The only task which was performed before this error appeared was a re-index from the cli. The admin panel is still accessible but i am unsure what is causing this error.