texts: Magento 2 - read and write new customer attribute

texts:
I added a new customer attribute n2gEmails:

app/code/Fekete/Newsletter2Go/etc/extension_attributes.xml:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
        <attribute code="n2gEmails" type="string"/>
    </extension_attributes>
</config>

app/code/Fekete/Newsletter2Go/Setup/Patch/Data/AddN2gEmailsCustomerAttribute.php:

<?php

namespace Fekete\Newsletter2Go\Setup\Patch\Data;

use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchRevertableInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Customer\Setup\CustomerSetup;

class AddN2gEmailsCustomerAttribute implements DataPatchInterface, PatchRevertableInterface
{

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

    /**
     * Constructor
     *
     * @param ModuleDataSetupInterface $moduleDataSetup
     * @param CustomerSetupFactory $customerSetupFactory
     */
    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        CustomerSetupFactory $customerSetupFactory
    ) {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->customerSetupFactory = $customerSetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function apply()
    {
        $this->moduleDataSetup->getConnection()->startSetup();
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]);
        $customerSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY,
            'n2gEmails',
            [
                'type' => 'varchar',
                'label' => 'Newsletter2Go Emails',
                'input' => 'text',
                'source' => '',
                'required' => false,
                'visible' => true,
                'position' => 333,
                'system' => false,
                'backend' => ''
            ]
        );

        $attribute = $customerSetup->getEavConfig()->getAttribute('customer', 'n2gEmails')->addData([
            'used_in_forms' => [
                'adminhtml_customer',
                'customer_account_create',
                'customer_account_edit'
            ]
        ]);
        $attribute->save();

        $this->moduleDataSetup->getConnection()->endSetup();
    }

    public function revert()
    {
        $this->moduleDataSetup->getConnection()->startSetup();
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
        $customerSetup->removeAttribute(\Magento\Customer\Model\Customer::ENTITY, 'n2gEmails');

        $this->moduleDataSetup->getConnection()->endSetup();
    }

    /**
     * {@inheritdoc}
     */
    public function getAliases()
    {
        return [];
    }

    /**
     * {@inheritdoc}
     */
    public static function getDependencies()
    {
        return [

        ];
    }

}

Then I executed php bin/magento setup:upgrade.

How can I access this attribute now?


texts: Magento 1.9.x Products Descriptions Missing in Admin

texts: After updating products information. Products Description is missing and short description is replacing with old short description


texts:
In

src/app/code/myModul/Model/Webforms.php

I have a :

$this->_init('webforms/webforms');

What is it do?


texts:
I add 1 category name Category, and add sub categories to it. But, because there's too much sub categories, i need to scroll down the page first to see the full list of the sub categories. So my plan is add scroll bar to the subcategory, then customer could see the full sub categories with scroll down. I tried to add some css code in sections.phtml like in code below, but it's not work, is there something i miss?

CSS :

<style type="text/css">
    nav ul li ul{
        overflow-y: scroll !important;
        height: 400px;
        max-height: 500px;
    }
</style>


texts:
I have to specifiy the following table rates, but I have no idea how the file must look. These are the rules

Germany (DE) --> 3.90 EUR, if the order total is > 35 EUR, free shipping
Any other country except Germany --> 7.70 EUR, if the order total is > 50 EUR, free shipping

How would I define that?

Thanks!


texts: How to make an artifact from a module instead of installing in app/code?

texts: I have a module from a payment system. I added them to app/code. But now, to make a simple rewrite of the module template, I need to do more than just copy it if the module was in the vendor. Tell me how you can make an artifact from the module so that it is automatically transferred to the vendor through the composer


texts:
I'm using Magento:2 REST Api in my website, and currently working on the payment system (Authorize.net).

Is it possible to create a transaction ? and place an order with Authorize.net
through the Magento Api after setting up Authorize.net in the admin?


texts: Product inventory by attribute (visual swatch)

texts:
I use the "Visual swatch" attribute to offer products in different colors. Most products have the same available colors. For example "bag A" and "bag B" can be sold in red and blue.

Is it possible to disable the blue color for all products ? In my case if I am out of the blue color I cannot produce and offer any product in blue.


texts: Layout update customer account create not working

texts:
I'm trying to set the page template to 2columns-left.phtml for the account creation page in local.xml

<customer_account_create>
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>
</customer_account_create>

It's however not working. What am I missing here?


texts: Magento 2 Data Migration Tool ignore unknown documents

texts:
I am going to migrate data with the Magento 2 Data Migration Tool. Because the Magento 1 installation I want to migrate has lots of custom tables that come from extensions, I get tons of errors when migrating data. I would be fine to only migrate the standard magento tables.

Do I have to add an ignore statement to the map.xml file for every document I want to ignore? This is a lot of work for me, so my question is, is there any possibility to tell the migration tool to just ignore unknown documents?

My workaround would be to figure out some handy search/replace pattern to generate the xml from the error message I get from the data migration tool.


texts: Add filtrable attribute column in products in category grid

texts:
I'm using Magento 2.3 and I'm trying to add a column with an attribute inside the "products in category" grid (Catalog->Categories->Products in Category).
I've created a custom module and the file Product.php in

  Mycompany\Mymodule\Block\Catalog\Adminhtml\Category\Tab

I'm pasting the code below:

<?php

namespace Mycompany\Mymodule\Block\Catalog\Adminhtml\Category\Tab;

use Magento\Backend\Block\Widget\Grid\Extended;
use Magento\Backend\Block\Widget\Grid;

class Product extends \Magento\Catalog\Block\Adminhtml\Category\Tab\Product
{

/**
 * @return Grid
 */
protected function _prepareCollection()
{

    $grid = parent::_prepareCollection();

    $collection = $this->getCollection()->addAttributeToSelect('manufacturer');

    $this->setCollection($collection);
    if ($this->getCollection()->isLoaded()) {
        $this->getCollection()->clear();
    }

    return $grid;
}

/**
 * @return Extended
 */
protected function _prepareColumns()
{
    parent::_prepareColumns();

    $this->addColumn(
        'manufacturer',
        [
            'header' => __('Manufacturer'),
            'name' => 'manufacturer',
            'index' => 'manufacturer',
        ]
    );

    return $this;
}
}

I'm attaching the screenshot of the result:

As you can see the column gets added and the attribute displayed, but with the id of the option instead of the text label.
How can I change my code so that it returns the attribute label (in this case woul be "test") instead of the value?
Any help is greatly appreciated, thanks!


texts: Make product data tabs collapsed by default

texts:
I want all product data tabs on the product details page to be collapsed by default.
I edited this line in app/design/frontend/<Namespace>/<theme>/Magento_Catalog/templates/product/view/details.phtml

This does what I want but with the following problem:
On page load the reviews tab is expaned, for a short time.
It then gets closed during page load and after the page has rendered all tabs are collapsed.
This creates a visual effect that I don't like.
How can I make all tabs be collapsed from the start instead.
Here's the rest of the template, should be Magento default though apart from my change:
<?php
/** @var \Magento\Catalog\Block\Product\View\Details $block */
?>
<?php if ($detailedInfoGroup = $block->getGroupSortedChildNames('detailed_info', 'getChildHtml')) :?>

        <?php $layout = $block->getLayout(); ?>

            <?php foreach ($detailedInfoGroup as $name) :?>
                <?php
                $html = $layout->renderElement($name);
                if (!trim($html)) {
                    continue;
                }
                $alias = $layout->getElementAlias($name);
                $label = $block->getChildData($alias, 'title');
                ?>
                <div class="data item title"
                     data-role="collapsible" id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>">
                    <a class="data switch"
                       tabindex="-1"
                       data-toggle="trigger"
                       href="#<?= $block->escapeUrl($alias) ?>"
                       id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>-title">
                        <?= /* @noEscape */ $label ?>

                <div class="data item content"
                     aria-labelledby="tab-label-<?= $block->escapeHtmlAttr($alias) ?>-title" id="<?= $block->escapeHtmlAttr($alias) ?>" data-role="content">

<?= /* @noEscape */ $html ?>

            <?php endforeach;?>

<?php endif; ?>


texts: want to replace select button with add to cart button in product list

texts:
Currently when I click onto a category and see a list of products, it puts a select button next to each product in list mode. Select brings you to the product page.

I would like to replace that select button with an add to cart button that adds the product to the cart from the product list.

Here is my current list.phtml that has select button:   https://bpaste.net/show/e4e3e977c8ee

Here is my attempt at making a list.phtml that has an add to cart button rather than a select button. https://bpaste.net/show/5145c07340f4

Here is my view.phtml file for the actual product page where I stole some of the add to cart code from: https://bpaste.net/show/d147bd4b2464


texts:
So I have a couple of "Custom" manually installed extension (installed without using MAGENTO Installed)
When I go to Advanced tab and click "Disable", these extension still execute their normal functions. Basically continue working as it is.
System > Configuration > Advanced

For me to completely disable extension I have to go to "etc" folder and change "True" to "False"

Do you think the reason I cannot disable  extensions form back-end admin panel is due to recent SUPEE patch updates?


texts: Magneto1 I have getting error in console product detail page

texts:
I have getting error in prototype.js product detail page if any one idea please share your inputs as soon as .

TypeError: Form.Element.Serializers[method] is not a function


texts: Magento2 : How to get order-total in shipping email

texts: I like to get order-total in shipping email template of magento 2.3


texts: How to remove spam customer account through extension in magento 1.9

texts:
I have some spam customer so how can i remove spam customer account in this site and how to disallow this account through the extension for Magento 1.9
please give me a suggestion for that if any extension link or tool then give me for Magento 1.9
please help me.
Thank you.


texts: Filter collection by config product attribute value in magento 2 programmatically

texts:
I would like to know. How can i filter collection by attributes value as I am making filter api for app. Please check below code where i am filter the collection this is working for simple products but for configuration i'm facing an issue

   foreach ($productInfo['attrs'] as $attr) {

                if ($attr->code == 'price') {
                    foreach ($attr->values as $key => $value) {
                            $rr[] = explode("-", $value);
                    }
                      $min = min(array_column($rr, '0'));
                      $max = max(array_column($rr, '1'));
                    $collection->addAttributeToFilter('price', ['from' => $min, 'to' => $max]);
                }
                   if ($attr->code != 'price' && $attr->code != 'cat' ) {
                        $collection->addAttributeToFilter($attr->code, array('eq' => $attr->values));

                    }
                    if ($attr->code == 'cat') {
                       // print_r($attr->values);
                         $collection->addCategoriesFilter(['in' =>$attr->values ]);
                    }
                     if ($attr->code == 'ram') {
                       // print_r($attr->values);
                         $collection->addFieldToFilter('ram', ['in' => $attr->values]);
                    }

            }

where I am receiving the value on this format

{"customer_id":"10","category_id":"3","page":"1","sort":"1", "attrs":[
        {
                "code":"price","values":["1000-30000"]
        },
         {
                "code":"ram","values":["6","7"]
        },
        {
                "code":"color","values":["12"]
        },
          ]}


texts: I have installed the Magento 2.2.1 in my demo server. I want to show currency switcher in my store. But Its works for only US Dollar and Euro.Other currencies  does not display.


texts: disable configurable products if the associated products have quantity 0

texts:
Magento 1.9.x
I have to enable the backorder.
How can I disable all CONFIGURABLE products that have associated products with quantity 0?
Is there a SQL query that allows me to do this? (via admin backend I don't think it's possible)
Thank you!


texts: Magento 2.1.1: How can we add Payment Information (custom payment) to an order?

texts: I have a custom payment gateway that pass additional payment information back upon the return to Magento store that I would like to store on the associated order, so that it can be displayed on the admin page, similarly to what Paypal Express Checkout offer as shown below. What would be the best practice to do this (I prefer have it done within a controller action that handle the return).


texts: Magento - how to create new product type based on bundle product

texts:
I have problem about how to create new product type based on Bundle product.

I create my module and extends Mage_Bundle_Model_Product_Type in NameSpace/ModuleName/Model/Product/Type/myproducttype.php. So if I going to admin and create my new product type, product look like simple product not bundle product.

in my config.xml is

<catalog>
  <product>
    <type>
      <formula translate="label" module="bank">
        <label>Formula Product</label>
        <model>bank/product_type_formula</model>
        <price_model>bank/product_type_formula_price</price_model>
      </formula>
    </type>
  </product>
</catalog>

in my Formula.php is

<?php

class xxxx_Bank_Model_Product_Type_Formula extends Mage_Bundle_Model_Product_Type
{
public function isVirtual($product = null)
{
    return true;
}
}

?>

I don't know why. can you help me ?


texts: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away Error after migration; details of log file in text

texts:
Magento 1.9.1

We just got migrated to a different node because we had performance problems on the old node (within the same hosting company) and ever since then, none of our Magento stores even load.

When trying to load the front pages - the following Errors come up:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was: INSERT INTO `mg_log_visitor` (`session_id`, `first_visit_at`, `last_visit_at`, `last_url_id`, `store_id`) VALUES (?, ?, ?, ?, ?)

SQLSTATE[HY000] [2002] Connection refused

SQLSTATE[HY000] [2002] No such file or directory

I think this always happened to us after this hosting company migrated us to a different 'node'. It must be some kind of a configuration issue?

Here are the most current entries in the system.log file:

  2019-02-21T10:49:40+00:00 ERR (3): Warning: PDOStatement::execute():
  MySQL server has gone away  in
  /home/oursite/public_html/includes/src/__default.php on line 65404
  2019-02-21T10:49:40+00:00 ERR (3): Warning: PDOStatement::execute():
  Error reading result set's header  in
  /home/oursite/public_html/includes/src/__default.php on line 65404
  2019-02-21T10:49:40+00:00 ERR (3): Warning: PDO::__construct(): MySQL
  server has gone away  in
  /home/oursite/public_html/includes/src/__default.php on line 55207
  2019-02-21T10:49:40+00:00 ERR (3): Warning: PDO::__construct(): Error
  while reading greeting packet. PID=15481  in
  /home/outsite/public_html/includes/src/__default.php on line 55207

The hosting company is trying to blame this on Magento but I know it's some kind of a mis-configuration after the migration (we were running successfully without problems for years).

This is a reply from our hosting company:

The main issue - server reaches memory usage limit.
Here is summary Dabase size
root@new [/]# du -sh /var/lib/mysql/
7.1G /var/lib/mysql/
And memory usage:
root@new [/]# free -m
total used free shared buffers cached
Mem: 6144 6144 0 6723 0 526
-/+ buffers/cache: 5617 526
Swap: 0 0 0

Server have only 400MB free which abnormal for stable work.
I'll recommend reducing the database size and disable any kind of statistics / debugging to avoid mysql overload, or increase RAM twice. Also as I see your server have nginx on board, but for some reason nginx service is inactive, any reason why it's disabled? We can help with nginx optimization because I recommend use web servers like nginx / litespeed on highload servers.

How do I disable statistics/debugging?

Anything else I can do to bring the site back up?


texts: modman: Is it ok to delete .git subdirectories?

texts:
I see that for every extension installed via modman there is a subdirectory named .git

I am not familiar with how Git works as I have used SVN only. My question is:

Is it ok to delete these .git directories after the extension is installed or does modman need them (e.g. for version updates etc)?


texts: Magento 2 validate customer session with extra parameters

texts:
I have implemented Two factor authentication for customers.

So customer logins from frontend and if they have entered login details correct then they will be redirected to our two factor authentication page.

My question is now if user enter directly in URL http://mymagento.com/customer/account/index/ in new tab they are easily accessing their account without passing through two factor authentication.

I know to resolve this issue I need to add one more condition weather they have passed two factor auth or not. But I am not getting from where magento checks if customer session is valid or not ?

If I will get code from where Magento 2 is validating user session I will modify it, I will add one more flag in customer session 'two_factor' true/false. And I can validate it.
If you have any idea from where Magento checks customer session is valid or not ?


texts: Magento 2 - how to use count and group by clause in collection

texts:
i have order collection and want to this query result like

`SELECT `created_at`,COUNT(`entity_id`)  FROM `sales_order_item` GROUP BY `created_at`;

i use this query

`$selectCollection=$this->ordercollection->create()->addFieldToSelect('entity_id')->addFieldToSelect('created_at');

        $querycollection=$selectCollection->getSelect('COUNT(`entity_id`)')->group('created_at');`

But not work

Just i want to get how many orders come on each date or every day ?


texts: How to keep clients on Magento 1 given that end of life is in 11/2018

texts:
Magento will not release any new security patches from 11/2018 for Magento 1.

Of course, there are a lot of small and not so small websites out there that are on Magento 1 that can't afford to move to Magento 2 (especially given the current relatively bigger costs to develop a new Magento 2 site).

From a developer point of view, what assurances (regarding security/bug fixes) can we give to current clients to stay on Magento 1 even after 2018 and continue to invest in new features and not switch to a new platform?

From similar experiences on other platforms did the community/hosting companies keep focus on the old version and continued to offer security fixes?


texts: Subscribing to a newsletter without creating an account

texts:
Is it possible to subscribe to a newsletter without the user having to create an account? So on a page have some fields, like email, name etc and store them in the newsletter data?

How would I do something like that?

My form code:

<? $pageid =  Mage::getBlockSingleton('cms/page')->getPage()->getId();

  if($pageid == '20'){
    echo '
    <form id="contact-form" action="https://natuurgroothandel.com/nieuwsbrief.php" method="post" class="contact_form row contact-form" role="form">

          Naam
          <input type="text" name="name" class="form-control form-control-name" value="" tabindex="1" maxlength="35">

          Geslacht
          <input type="text" name="gender" class="form-control form-control-email h5-email" value="" tabindex="1" maxlength="35">

          Geboortedatum
          <input type="text" name="date" class="form-control form-control-phone" value="" tabindex="1" maxlength="35">

          Emailadres
          <input type="text" name="email" class="form-control form-control-phone" value="" tabindex="1" maxlength="35" required>

          <button class="btn btn-fullcolor" type="submit">Verzenden</button>

      </form>';
  }
?>


texts: magento Add Coupon code at sales order grid

texts:
I want to add coupon code in sales order grid . As we know Sales order gird build from sales_flat_order_grid table

Coupon_code column is exist in sales_flat_order table not sales_flat_order_grid table.

When  i add  coupon_code at sales order grid but when I search the coupon code with status column then got this error : Column 'status' in where clause is ambiguous

Note : I am working on existing project not new project

Magento version : 1.7.0.2

Can you please provide me solution


texts: Abandoned carts being updated at same time

texts:
Periodically the abandoned carts are all being updated at same time. It happened 3-4 times by now. I don't know what is causing the behaviour and if it is an actual problem.
Below is an image from the most recent ocurrence.

I searched if it was a cron job, server update, database error, but it seems to be a Magento behaviour. My Magento version is 2.2.4.
I'm a bit lost. Please ask for any details and I will update the question.


texts:
Hello guys , I am currently on magento version 2.3.0 and I am getting this error whenever I try adding a product in my admin panel.
Can someone kindly assist me .

After running php bin/magento setup:di:compile

I get this error when loading my admin panel.

Fatal error: Uncaught Error: Call to a member function setActive() on boolean in C:\xampp\htdocs\providencecameras\vendor\magento\module-backend\Model\View\Result\Page.php:27 Stack trace: #0 C:\xampp\htdocs\providencecameras\vendor\magento\module-backend\Controller\Adminhtml\Dashboard\Index.php(39): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Backend...') #1 C:\xampp\htdocs\providencecameras\vendor\magento\framework\App\Action\Action.php(108): Magento\Backend\Controller\Adminhtml\Dashboard\Index->execute() #2 C:\xampp\htdocs\providencecameras\vendor\magento\module-backend\App\AbstractAction.php(231): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #3 C:\xampp\htdocs\providencecameras\vendor\magento\framework\App\FrontController.php(159): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http)) #4 C:\xampp\htdocs\providencecameras\vendor\magento\framework\App\FrontController.php(99): Magento\Framework\App\FrontController->processRe in C:\xampp\htdocs\providencecameras\vendor\magento\module-backend\Model\View\Result\Page.php on line 27


texts: How to change date format for backend in Magento 2

texts:
On Order-Sales tab  we have Filters.
Here  we have Purchase Date which it's a date picker, and by default, the date format it's mm/dd/yy.

I want to make this date filed to be dd/mm/yy but i can't find any solution.
The only thing that i found it's this xml: sales_order_grid.xml located in module-sales/view/adminhtml/ui_component wich have this lines responsabile for that filed:

 <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">dateRange</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
                    <item name="dataType" xsi:type="string">date</item>
                    <item name="label" xsi:type="string" translate="true">Purchase Date</item>
                    <item name="dateFormat" xsi:type="string">MMM dd, YYYY, H:MM:SS A</item>
                </item>
            </argument>'

Here i have this line <item name="dateFormat" xsi:type="string">MMM dd, YYYY, H:MM:SS A</item>. If i change this in DD MM, YYY nothing happend.
I already change the date format form backend settings to dd/mm/yyy and nothing happend

Does anyone know how can i change this date format? or it's another way to do this except this xml?


texts:
I'm having huge problems with shipping on Magento 1.9.1

I've tried using Table Rates & the Extension by webshopapps, both giving me grief and defaulting to the * * Postcode range $606 (I just put this figure to test) as shown below;

Country Region/State    City    Zip/Postal Code From    Zip/Postal Code To  Order Subtotal From Order Subtotal To   Shipping Price  Delivery Type

AUS                         0   9999999 606 Delivery
AUS *   NSW 1100    1299    0   9999999 35  Delivery
AUS *   NSW 2000    2234    0   9999999 35  Delivery
AUS *   NSW 2235    2999    0   9999999 50  Delivery
AUS *   VIC 3000    3207    0   9999999 35  Delivery
AUS *   VIC 3208    3999    0   9999999 50  Delivery
AUS *   QLD 4000    4199    0   9999999 60  Delivery
AUS *   QLD 4208    4287    0   9999999 70  Delivery
AUS *   QLD 4288    4299    0   9999999 110 Delivery
AUS *   QLD 4300    4305    0   9999999 60  Delivery
AUS *   QLD 4306    4499    0   9999999 110 Delivery
AUS *   QLD 4500    4519    0   9999999 60  Delivery
AUS *   QLD 4520    4999    0   9999999 110 Delivery
AUS *   SA  5000    5199    0   9999999 35  Delivery
AUS *   SA  5200    5999    0   9999999 60  Delivery
AUS *   WA  6000    6199    0   9999999 60  Delivery
AUS *   WA  6200    6797    0   9999999 150 Delivery
AUS *   TAS 7000    7999    0   9999999 60  Delivery
AUS *   NT  800     899     0   9999999 130 Delivery
AUS *   QLD 9000    9015    0   9999999 60  Delivery

This is a sample .csv I downloaded and then edited and uploaded, is there something here I'm doing wrong?

If I use the default Australia Post within Magento, it does not split the packages into different boxes for delivery. I ship Computers/Computer parts so alot of customers cannot order more then 2 items as it exceeds the maximum weight range of Australia Posts 22KG. If I set the weight of the items to 0 this allows my customers to order more then two/three items but costs me money as the shipping is not calculating correctly.

EDIT: This issue still has not been resolved. If anyone has any extra information that would be great.


texts: How can I Get Company Name from customer Billing Address in Customer information tab in Admin?

texts:
I am trying to get Company Name to display in Magento admin but I can't get the value for just the Company name and nothing else.

Here is my code

<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>

Can anyone let me know what I've done wrong here?


texts:
namespace Magento\Review\Block\Product\ReviewRenderer;

if ($product->getRatingSummary() === null) {
        $this->reviewSummaryFactory->create()->appendSummaryDataToObject(
            $product,
            $this->_storeManager->getStore()->getId()
        );
}

this is Magento2.3.3 review renderer Block code its rating starts not shwoing on home page but when i comment this line

//  if ($product->getRatingSummary() === null) {

its shows on home page is it right solution can any one guide or its a Magento2.3.3 bug


texts: How to make RWD "Reviews" link open "Reviews" tab?

texts:
By the default, the "x Review(s)" link, links to the review page. How do we make it link to the "Review" tab instead, using the default RWD template?

Example:

When you click the "x Review(s)" link, the "Reviews" tab is activated, and page scrolls down to it...

Other stuff:

app.js controls this via:

//Toggle on tab (li) click.
    if (hasTabs) {
        lis.on('click', function (e) {
            toggleClasses(jQuery(this), lis);
        });
        //Open the first tab.
        lis.eq(0).trigger('click');
    }


texts: programatically search products in magento 2. Please help me to get products using search criteria.


texts: In Magento 2.3.x How to add dependent Customer Attribute

texts:
In Magento 2.3.x, How to add dependent Customer Attribute.

It means Need to add 2 attributes like

yes/no option
Textbox (Based on the option selected)


texts: Can one order be attributed to more than one store in multistore

texts:
I've been looking at the core code for the store column renderer in adminhtml sales (Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Store) and the render functions are really confusing me.

The nested foreach loops at the end of the render and renderExport methods appear to suggest that a single order could be attributed to multiple stores, but that makes no sense to me at all. Here is the core code from 1.9

$data = $this->_getStoreModel()->getStoresStructure(false, $origStores);

foreach ($data as $website) {
    $out .= $website['label'] . "\r\n";
    foreach ($website['children'] as $group) {
        $out .= str_repeat(' ', 3) . $group['label'] . "\r\n";
        foreach ($group['children'] as $store) {
            $out .= str_repeat(' ', 6) . $store['label'] . "\r\n";
        }
    }
}

In what situation would the above code ever generate more than one website, group or store element?

Is it that this renderer can be called in contexts other than relating to a single order? I can see if it were called for a group of orders, then it would made sense to show all the website, groups and store elements.


texts: Magento 2.3.4 - Swatch Renderer assumes all attributes are swatches

texts:
See line 726 of the new swatch-renderer.js file for Magento 2.3.4 here.

The jsonSwatchConfig JSON object only includes data for swatch-type attributes. (See \Magento\Swatches\Helper\Data::getSwatchAttributes.) However, the above line in the latest version of swatch-renderer.js assumes that all attributes it encounters _onClick will exist in this JSON.

This results in the following error when clicking non-swatch attributes:

Uncaught TypeError: Cannot read property 'additional_data' of undefined

It is possible to mix swatch and non-swatch attributes in a Configurable product. Is this a new core bug in 2.3.4?


texts: Magento 1.9 : 404 Error Page not found for configruation

texts: I created system xml and configuration tab but it shows 404 error. Any hint?


texts:
I just discovered Pixafy, a Magento CE SaaS solution.

One thing that strikes me, it that CE is under the OSL license. Does it allow you to take an existing product, turn it into a SaaS and charge money?

From what I can tell, Pixafy has hugely altered Magento, including the backend, and is not releasing it's modifications as open source. FTP access is (as far as I can tell) not available and you cannot leave the platform without losing your store. Only data export is offered, so you'd need to start again from scratch.

Do they have a special deal with Magento for this? Pixafiy is a gold partner and their SaaS solution was featured on the official Magento website.


texts: Getting Invalid block type with custom extension

texts:
I have created a custom module so that I can call a block from a cms page.

{{block type="wpsync/getpostcontent" template="wpsync/getpostcontent.phtml" wpurl="http://localhost/about"}}

I am getting

exception 'Mage_Core_Exception' with message 'Invalid block type:

Can't see what I am doing wrong.

local/Elevated/Wpsync/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Elevated_Wpsync>
            <version>1.0</version>
        </Elevated_Wpsync>
    </modules>
    <global>
        <blocks>
            <getpostcontent>
                <class>Elevated_Wpsync_Block</class>
            </getpostcontent>
        </blocks>
        <models>
            <getpostcontent>
                <class>Elevated_Wpsync_Model</class>
            </getpostcontent>
        </models>
    </global>
</config>

local/Elevated/Wpsync/Block/Getpostcontent.php

<?php
class Elevated_Wpsync_Block_Getpostcontent extends Mage_Core_Block_Template {
    public function getPostContentFromUrl() {

        $url = $this->getData('wpurl');
        // call model to fetch data
        $pagecontent = Mage::getModel("wpsync/getpostcontent")->getPostContentFromUrl($url);

        return $pagecontent;
    }
}

local/Elevated/Wpsync/Model/Getpostcontent.php

<?php

class Elevated_Wpsync_Model_Getpostcontent extends Mage_Core_Model_Abstract {
    public function getPostContentFromUrl($url) {
        return "hello";
    }
}

app/etc/modules/Elevated_Wpsync.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Elevated_Wpsync>
            <active>true</active>
            <codePool>local</codePool>
        </Elevated_Wpsync>
    </modules>
</config>

app/design/frontend/default/default/template/wpsync/getpostcontent.phtml

<?php
    echo $this->getPostContentFromUrl();


texts: Magento 2: How to change config value within one process / request?

texts:
For integration tests purposes I need to set a different config value to a single config directive. However the configInterface always returns the value which was set as the first one.

Code of the test:

class FooTest extends AbstractTestCase
{

    public function testFoo()
    {
        $this->setConfig('cataloginventory/options/show_out_of_stock', 0);

        ...
    }

    public function testBar()
    {
        $this->setConfig('cataloginventory/options/show_out_of_stock', 1);

        ...
    }

    private function setConfig($path, $value)
    {
        /** @var \Magento\Config\Model\ResourceModel\Config $model */
        $model = $this->getObjectManager()->create('Magento\Config\Model\ResourceModel\Config');
        $model->saveConfig($path, $value, 'default', 0);

        /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */
        $cacheTypeList = $this->getObjectManager()->create('Magento\Framework\App\Cache\TypeListInterface');
        $cacheTypeList->cleanType('config');
    }

    /** @return \Magento\Framework\ObjectManagerInterface */
    protected function getObjectManager()
    {
        return Bootstrap::getObjectManager();
    }

}

Code of the config value fetching within my extension:

class ConfigHelper
{
    private $configInterface;

    public function __construct(Magento\Framework\App\Config\ScopeConfigInterface $configInterface)
    {
        $this->configInterface = $configInterface;
    }

    public function getShowOutOfStock($storeId = null)
    {
        return (bool) $this->configInterface->getValue('cataloginventory/options/show_out_of_stock', ScopeInterface::SCOPE_STORE, $storeId);
    }
}

The value fetched by ConfigHelper is always the one which is set in testFoo() method. The value set in testBar() method is saved to DB, but value returned by getShowOutOfStock() is always the first one.

I'm wondering how to modify the setConfig() method to invalidate the internal Magento cache and to fetch the real value.

Any help appreciated, thanks!


texts:
My sitemap.html won't generate. We recently did a site migration from one magento platform to another so I'm thinking this could be a reason, but would love to hear any feedback from you all.

The sitemap.xml and robots.txt are all in place after we uploaded the files to server, so would this solve issue or do I need to download something like creare?

Thanks for your help,
-Reed


texts: Onepage Checkout - Displaying Billing/Shipping Address (Outside Progress Sidebar)

texts:
What is the best way to display customer-entered information such as billing, shipping, and payment info into the checkout process?

The following is an example to demonstrate what I mean.

The first step is the customer has to enter their billing information:

The customer proceeds with shipping information, shipping method, and payment information before reviewing the order:

I would like to display previously entered information under each section where the "Edit" links are, once the customer is past each step. Is there a way to do this?

Some additional information:

The progress sidebar is hidden via /theme/skin/frontend/[package]/default/css/styles.css:

#checkout-progress-wrapper {display:none;}

Here is my /app/design/frontend/[package]/default/template/checkout/onepage.phtml:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>

<?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
<?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
    <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">

            <?php echo $i ?>

<?php echo $_stepInfo['label'] ?>

            <?php echo $this->__('Edit') ?>

        <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
            <?php echo $this->getChildHtml($_stepId) ?>

<?php endforeach ?>

<input type="hidden" name="checkout_method" id="login:guest" checked="checked" value="guest"/>

Thanks for any help or suggestions!


texts: Cannot save any category on Magento 2.3.2

texts:
When I try to save any categories, I am receiving the following error:

PHP Fatal error:  Uncaught Error: Call to a member function getBackend() on boolean in /var/domains/../vendor/magento/module-eav/Model/Entity/AbstractEntity.php:1666
Stack trace:
#0 /var/../vendor/magento/module-catalog-url-rewrite/Observer/CategoryUrlPathAutogeneratorObserver.php(98): Magento\Eav\Model\Entity\AbstractEntity->saveAttribute(Object(Magento\Catalog\Model\Category\Interceptor), 'url_path')
#1 /var/../vendor/magento/module-catalog-url-rewrite/Observer/CategoryUrlPathAutogeneratorObserver.php(74): Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver->updateUrlKey(Object(Magento\Catalog\Model\Category\Interceptor), 'douche')
#2 /var/../vendor/magento/framework/Event/Invoker/InvokerDefault.php(88) in /var/../vendor/magento/module-eav/Model/Entity/AbstractEntity.php on line 1666

Does anyone know what could trigger this error message and how can it be fixed ?

Thank you


texts: Magento 2 cannot change order status to custom from complete

texts:
I want to change the order status from complete to custom  status but unable to do so. My code is:

 $orderState = 'customstatus';
        $order->setState($orderState)->setStatus('customstatus');
        $order->save();

Still it remains same.
How to change?


texts: Magento 2 Admin panel configration migration

texts:
How can we migrate Magento 2 Admin panel configurations from one magento 2 project to another.

Lets say we did some configuration in DEV server and when you setup UAT server you will need to do the same configurations manually again. So i am looking to automate this process.

If i can get some way to extract the configurations of one server and updated the same in another.

Please suggest.


texts: custom var in _module.less -> deploy problem

texts:
I have created my own theme, extending Magento/blank. In my own theme, I have included bootstrap among others, and removed the less files from the default theme (I'm not using stles-l.css or styles-m.css).

In some _module.less files from various modules I have created, I'm using bootstrap's vars.

Everything works fine when I do a static-content:deploy for my own theme.

However, if I do a static-content:deploy for the blank theme, errors are generated, because the custom vars specific to my own theme are not defined. Which is normal.

Maybe I'm too lazy to figure it out myself, but has anyone had this sort of issue?

I don't need to use the blank theme at all, but sometimes I need to change between deploy modes (deploy:mode:set), and then, this happens:

Something went wrong while deploying static content. See the error log for details. Command returned non-zero exit code:

/usr/bin/php7.0 -f /public/bin/magento setup:static-content:deploy fr_FR en_US

The deploy command is run as it is, without a -t param, and generates a mess.

I could change the deploy mode without using cli, but this is not my question.

Cheers! :)


texts: Magento 2 smtp could not open socket in Aws Setup For Magento2

texts:
My Site is on aws instant and I am used gmail smtp for sending mail from that but I have one sending mail error and try to solve it but not get any solution

This kind of error I find when I send mail throw gmail smtp in my aws setup magento2.

Could not open socket: stream_socket_client():
php_network_getaddresses: getaddrinfo failed: Temporary failure in
name resolution

I check my php info file in that open ssl was all ready enable

And I also try to do some code in abstract.php file


texts: get querystring variables to display on static page

texts:
How to get querystring information and display on a landingpage?

This is a link created on another website with variables to pass to magento2.3.1 website.
www.mymagentowebsite.com/staticpage.html?w=150&h=220&c=2&shape=LZ0005

now I want to get the variables w,h,c and shape
and display them on a static page.


texts: Add collection of products to a category

texts:
How can i programmatically add a collection of products to a specific category without having to assign each one of them manually ?

Thank you in advance.


texts: my custom layout.xml file is not calling in magento

texts:
my custom layout file is not calling, I configured backend also.

in my controller Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles()); I debug it it is returning like this

array(5) {
  [0] => string(7) "default"
  [1] => string(13) "STORE_default"
  [2] => string(31) "THEME_frontend_easylife_default"
  [3] => string(16) "test_index_index"
  [4] => string(19) "customer_logged_out"
}

and I store log from magento\app\code\core\Mage\Core\Model\Layout\Update.php

Mage::log((array)$updateFiles);

it's returning

2014-01-27T13:01:00+00:00 DEBUG (7): Array
(
    [0] => core.xml
    ......
    [40] => easylife_test.xml
    [41] => moneybookers.xml
    [42] => local.xml
)

here also my layout file is calling but my header link is not displaying.

my magento\app\design\frontend\easylife\defalut\layout\easylife_test.xml
code is

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <remove name="right.reports.product.compared"></remove>
        <reference name="top.links">
            <action method="addLink" translate="label title">
                <label>Example</label>
                <url>http://google.com</url>
                <title>Example</title>
                <prepare/>
                <urlParams/>
                <position>100</position>
            </action>
        </reference>
    </default>
</layout>

Can I know what's wrong this code?

thanks.


texts: How to restrict specfic ip address to access magento site in .htaccess file in magento?

texts:
I have an idea below text in .htaccess file in magento root folder.
Order allow,deny tells your web server that the Allow rules are processed before the Deny rules.
Order deny, allow means that the deny rules are processed before the allow rules.

#

By default allow all access

Order allow,deny
Allow from all

After that i added below text
"Deny from 122.179.87.208"

above ip address is my system public ip address.But still i able to access  magento site(localhost)

and through cmd ipconfig command i get different ip now .using that ip address also i'm able to access my site.
So where my configuration is wrong.Thanks in advance.


texts: How to get all the attributes of the product?

texts:
How to get all the attributes of the current product in the template?

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

So I got the name, I have the attribute "allow_same_day_delivery" how do I get it?


texts: How to display Authorize.Net Direct Post response messages in checkout?

texts:
Magento 2.2.3
Authorize.Net Direct Post

When a transaction is denied, for whatever reason, Magento shows a generic message

  An error occurred on the server. Please try to place the order again.

at the top of the page.

Autorize.Net is returning an informative denial message in the x_response_reason_text return field.

Is there a reason that message is not displayed to the customer?

Is there a way to show that message to the customer?

As it stands, if the customer were to make a mistake typing in their credit card information and submit the transaction, Authorize.Net would return "The credit card number is invalid." in the x_response_reason_text field. If that message were to be displayed to the customer, they would be able to correct their card number and resubmit the transaction. As it stands, the customer would most likely assume there is an error on the server.


texts: Magento 2 Checkout not showing all fields

texts:
I am using Magento 2.0 and when I added old database data (from Magento1), some fields on checkout page just doesn't show. I checked Admin panel to see if there is anything wrong with Customer data or Checkout, Shipping, but it seems just fine.

Under Shipping Address, only Email address field, First name and Last name show. It is also mixed up, label is last name, but validation says: Please enter a valid email address (Ex: johndoe@domain.com) - so it is definitely type email.

In console, there are no errors.

Did it happen to anyone before?


texts: Observer not firing - adminhtml_block_html_before

texts:
I've been trying to develop a new module which will modify the admin html pages of a magento control panel but I'm having difficulty getting it to work. To debug I've rolled the module back to some really simple code to just write to the system.log file when the product edit page loads... and this still isnt working so I think I've got a problem with the observer actually firing. Can you see any problems?

app/etc/modules/tww_RemoveProductTabs.xml

<?xml version="1.0"?>
<config>
    <modules>
        <tww_RemoveProductTabs>
            <active>true</active>
            <codePool>local</codePool>
        </tww_RemoveProductTabs>
    </modules>
</config>

app/code/local/tww/RemoveProductTabs/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <tww_RemoveProductTabs>
            <version>0.1.0</version>
        </tww_RemoveProductTabs>
    </modules>
    <global>
        <models>
            <tww_RemoveProductTabs>
                <class>tww_RemoveProductTabs_Model</class>
            </tww_RemoveProductTabs>
        </models>
        <events>
            <adminhtml_block_html_before>
                <observers>
                    <tww_RemoveProductTabs>
                        <class>tww_RemoveProductTabs/observer</class>
                        <method>removeTabs</method>
                        <type>singleton</type>
                    </tww_RemoveProductTabs>
                </observers>
            </adminhtml_block_html_before>
        </events>
    </global>
</config>

app/code/local/tww/RemoveProductTabs/Model/Observer.php

<?php
    class tww_RemoveProductTabs_Model_Observer
    {
        public function removeTabs(Varien_Event_Observer $observer)
        {
            Mage::log("Observer triggered");
        }
    }
?>


texts: How do I get my root category included in navigation etc as my frontpage? I can't find the answer! I tried to put in a widget but that's not the same!!


texts: Adding New Field to Signup Form in Magento 2

texts:
I was added new field called "How did you get to know about us?" to my Signup From. using following code and it's appeared on Signup Page but when I signup that field doesn't show in the All customers table in admin. That new field doesn't save. How can I fix this ?

   <?php /* @escapeNotVerified */ echo __('How did you get to know about us?') ?>

     <input type="text" name="how_did_found" id="how_did_found" value="<?php echo $block->escapeHtml($block->getFormData()->getCustomField()) ?>" title="<?php /* @escapeNotVerified */ echo __('How did you get to know about us?') ?>" class="input-text">

Then I added the new Attribute as following

$customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY,
            'how_did_found',
            [
                'type' => 'varchar',
                'label' => 'How Did Found',
                'input' => 'text',
                'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
                'required' => true,
                'default' => '0',
                'sort_order' => 1000,
                'system' => false,
                'position' => 1000
            ]
);
        $howdidfound = $this->eavConfig->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'how_did_found');
        $howdidfound->setData(
           'used_in_forms',
            ['customer_register_address']
        );
        $howdidfound->save();


texts: How admin form are submitted in magento 2

texts:
I'm wondering how form inputs are interpreted in magento2 admin grids.

For example, add an input (manually via navigator console) in cart price rule creation form. The input value will not be sent with other parameters.

It's the same when adding an input with "htmlContent" element in ui_component form.

How to make my input sent with htmlContent ?

Edit :

This code in custom admin grid ui_component xml file :

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
---
    <fieldset name="custom" sortOrder="20">
        <settings>
            <collapsible>false</collapsible>
            <label translate="true">Custom</label>
        </settings>
        <container name="custom_container" sortOrder="10">
            <htmlContent name="html_content">
                <block class="Magento\Framework\View\Element\Template" template="Vendor_Module::input.phtml" />
            </htmlContent>
        </container>
    </fieldset>
</form>

input.phtml :

<input type="text" name="test_input" value="test_input" />

Input is not sent with the other <field> attributes of the ui_component form.


texts: Magento2: How to remove zip code in magento 2 address book page?

texts: How to remove zipcode field in magento 2 address book


texts: Window.print is not renedering proper output in magento 2 cart page

texts:
i have a feature wherein i m print a page but in that font-weight is not working.
given below is the code
@media print {
body {
    font-size: 10px;
    font-weight: 700;
}
}

Can anyone tell whats i m missing??? I tried targeting the element using id, class and element name too , but its not working.


texts: GeoIP issue when automatically setting storeview in Magento 2 (`geoip_country_code_by_name` function)

texts:
In order to automatically switch store views depending on a user's location we have decided to add the code provided here:Magento 2 pragmatically set storeview to ourindex.php file as shown below:
<?php
/**
 * Application entry point
 *
 * Example - run a particular store or website:
 * --------------------------------------------
 * require __DIR__ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 * \/** @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

try {
    require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
    echo <<getMessage()}

HTML;
    exit(1);
}

$myipaddressis = $_SERVER['REMOTE_ADDR'];
$mycountryis = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
$store='default';
if($mycountryis =='FR')
  {
   $store='FR';
  }
if($mycountryis =='ES')
  {
   $store='ES';
  }

$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $store;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

/**
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
 @var \Magento\Framework\App\Http $app
*/

$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

Although we did face some installation hurdles getting GeoIP work, we know that we have correctly installed the geoip_country_code_by_name function as we have tested it with a simple php file using the code below:
<?php
$myipaddressis = $_SERVER['REMOTE_ADDR'];
$mycountryis = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
$country = geoip_country_code_by_name('www.google.com');
if ($country) {
    echo 'This host is located in: ' . $country;
    echo ' ---- My ip address is: ' . $myipaddressis;
    echo ' ---- My country is: ' . $mycountryis;
}
?>

which produces the following output:
www.google.com is located in: US ---- My ip address is: 92.150.xxx.xx ---- My country is: FR

Therefore we know the issue is not comming from GeoIP. However, when we navigate to our store homepage nothing happens in other words the location does not change but we do not get any errors either - just the default page. We have checked error/debug logs and see nothing there which would hint at where the issue is coming from. Our guess is that there is something wrong in the code we have added to theindex.php file. Any pointers would be greatly appreciated.


texts: Add fields to shipping (and customer) address in checkout process

texts:
I know that I can add "Address lines" in Stores > Configuration > Customer Configuration > Name and Address Options > Number of Lines in a Street Address but the address is stored as a single String in quote_address table.

I need to have four separate fields for customer address:

Street
Number
Complement
District

And

Area code (before telephone field)

I'd like to show them in that order...

I've already created the number, complement, district, area_code columns in quote_address and customer_address_entitytables. Now I need to show it in frontend and save the custom data to these columns.

Any hints on how to accomplish this?


texts:
today a returning customer has called us to notify that during the checkout the product inside the cart has been substituted by others that haven't been added, so I tried by myself and I have seen that if I have already got some product inside my basket(addced during another logged in session) and I shop while I'm not logged in, then during the checkout, once I log in, the account cart override the current session one.
Is it a common behavior? Is there a way to fix/edit this method?
I'm using varnish and SSL on frontend, cookie domain: www.example.com


texts:
I want to add item to cart programatically so I used this piece of code.

$result = $proxy->shoppingCartProductAdd($sessionId, 4, array(array(
    'product_id' => '4',
    'sku' => 'simple_product',
    'qty' => '5',
    'options' => array(
        13 => '1000',
        14 => '10002',
        15 => '10001',
        16 => '10002',
    ),
    'bundle_option' => null,
    'bundle_option_qty' => null,
    'links' => null
)));

As you can noticed there are four options which are required. According to documentation key is a id of the option so i used ID and put the value but I stil get exception "Please specify the product required option(s)." but there is no more required option. Did I something wrong? option ids are for sure good.


texts: Magento2 : How to get equivalent class of "Mage::getModel('tax/calculation')"?

texts:
I am trying to convert below code in magento2. I'm unable to find equivalent class of Mage::getModel('tax/calculation') in Magento2.

$taxCalculation = Mage::getModel('tax/calculation');
$request = $taxCalculation->getRateRequest(null, null, null, $store);
$taxClassId = $_product->getTaxClassId();
$percent = $taxCalculation->getRate($request->setProductClassId($taxClassId));

Help appreciated.


texts: Can i get Idea? How to write PHP code if anyone of the selected Categories of products presents in the cart the shipping method is Admin selected one

texts:
If anyone of the selected Categories of products presents in the cart the shipping method is admin selected one. now  my shipping methods like user selections, like

1)DHL
2)FEDEX
3)INDIA POST

If the anyone of the selected Categories of products presents in the cart, no matter other categories of products also included in the cart. if my selected Categories of products presents in the cart the shipping method is INDIA POST

How can i solve this issue? can i get an idea about how to write Manual PHP Condition?


texts: Magento 2 Admin disable or Remove Default Billing Address checkbox

texts:
I am looking to disable or remove checkbox from Customer address list in admin area, as I do not want that even by mistake an admin deletes default billing address of customer.
Any idea how to achieve that.


texts:
While placing an order, there is an error occurred like this:

  "an error occurred on the server please try to place the order again"

then the cart becomes empty and we need to again add the product.

I don't get this error all time. When I place order in some time I face this problem.

Error log:

[2017-05-24 10:22:56] main.INFO: Theme layout update file '/var/www/html/m2/app/design/frontend/Mobac/porto/Magento_Catalog/layout/catalog_product_view.xml' is not valid.
Extra content at the end of the document
 Line: 23 [] []
[2017-05-24 10:22:56] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_463d019c92f3536ffbf7da4ca76d7b2e8 and handles sales_email_order_items: Please correct the XML data and try again.  [] []
[2017-05-24 10:22:57] main.ERROR: Unable to send mail.  [] []
[2017-05-24 10:23:01] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_4d41d8cd98f00b204e9800998ecf8427e and handles : Please correct the XML data and try again.  [] []


texts: Magento just displays PHP code content of a class and stops

texts:
I have a strange issue where any page load attempts simply outputs a string of PHP code. When inspecting the source code, it reveals that it's actually the entire content of a class file as shown below. This happens on a particular server and for any page request.

The same code base and database works fine on my local environment. Any idea what might be doing this?


texts: how to update order summary sidebar after dynamic product addition from checkout page

texts:
I have added a product to the cart through knockout js if the guest customer checked the option during checkout. I was able to update the mini cart also. But I could not update the Order summary sidebar. So even if I have added or removed the product from the cart it is not dynamically affecting the sidebar. Only if I refresh the whole page then only correct data is loading in the sidebar.

Do anyone know how to call the sidebar update through knockout js file "shipping.js"?

Any Ideas or suggestions for this requirement. Thanks in advance.


texts: I need to add masonry js to my theme in Magento 2

texts:
Im unable to successfully get masonry working for my Magento 2.0 theme. What i have done currently is i added the link to Masonry cdn to my file default_head_blocks.xml and also called the function from one of my CMS pages. But no luck, nothing works.

Here is my default_head_blocks.xml

    <?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
        <css src="css/styles-m.css" />
        <css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
        <css src="css/print.css" media="print" />
        <link src="https://fonts.googleapis.com/css?family=Roboto:400,300" src_type="url" />
        <link src="https://npmcdn.com/masonry-layout@4.0/dist/masonry.pkgd.min.js" src_type="url" />

</page>

Here is CMS page content

Grid 1

 Grid 2

Grid 3


texts:
My system mails (such as new order emails) are coming from example@server.example.com (only the address; without name). But i want to see the 'from' section as like 'Example.com' in inbox..

** It's not about Configuration > Store Email Addresses or Sales > Sales Email sections. Everthing is ok there; all addresses have a name.

Do you have any idea? How can i add NAME to stmp address with server files, or is there any other options?


texts: magento 2.2.6 to 2.3 upgrade fails with composer

texts:
I tried to upgrade my 2.2.6 Magento install with composer following the tutorial on Magento Website, but "composer update" fails with these errors :

Your requirements could not be resolved to an installable set of packages.

Problem 1
    - magento/inventory-composer-installer 1.0.3 requires composer-plugin-api ^1.1 -> no matching package found.
    - magento/product-community-edition 2.3.0 requires magento/inventory-composer-metapackage ^1.0.3 -> satisfiable by magento/inventory-composer-metapackage[1.0.3].
    - magento/inventory-composer-metapackage 1.0.3 requires magento/inventory-composer-installer ^1.0.3 -> satisfiable by magento/inventory-composer-installer[1.0.3].
    - Installation request for magento/product-community-edition 2.3.0 -> satisfiable by magento/product-community-edition[2.3.0].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Anyone experiencing this issue ?
Thank you, Magento gurus :)


texts:
I have a new website

In the email, when I register a new user, it's missing the password:

Why?


texts:
I have added best seller on my homepage
referring to this link https://blog.amasty.com/how-to-display-bestselling-products-in-magento-source-code/
but it is not responsive, I want to make it responsive so that products in best seller block doesn't hide with the horizontal scroll bar(at the bottom)


texts: How to create an invoice progrmatically in magento2?

texts:
I want to create or generate invoice automatically in the backend through programming when ever the user places an order. I tried a lot using the online  examples but with no result.

If I use the mageplaza tutorials, then it shows error while clearing the cache.
Is there any free module for this?

Can any one help me to do this. Thank you.


texts: Issue in Extenction attribute ::setCode()

texts:
Fatal Error: 'Uncaught Error: Call to undefined method** SimplifiedMagento\\Database\\Api\\Data\\AffiliateMemberExtension::setCode() in \/var\/www\/html\/Magento2\/app\/code\/SimplifiedMagento\/Attribute\/Model\/Plugin\/CodeAttributeExtension.php:25
Stack trace:
#0 \/var\/www\/html\/Magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(135): SimplifiedMagento\\Attribute\\Model\\Plugin\\CodeAttributeExtension->aroundGetAffiliateMemberById(Object(SimplifiedMagento\\Database\\Model\\AffiliateMemberRepository\\Interceptor), Object(Closure), 1)
#1 \/var\/www\/html\/Magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): SimplifiedMagento\\Database\\Model\\AffiliateMemberRepository\\Interceptor->Magento\\Framework\\Interception\\{closure}(1)
#2 \/var\/www\/html\/Magento2\/generated\/code\/SimplifiedMagento\/Database\/Model\/AffiliateMemberRepository\/Interceptor.php(39): SimplifiedMagento\\Database\\Model\\AffiliateMemberRepository\\Interceptor->___callPlugins('getAffiliateMem...', Array, NULL)
#3 [internal function]: SimplifiedMagento\\Database\\Model\\AffiliateM' in '\/var\/www\/html\/Magento2\/app\/code\/SimplifiedMagento\/Attribute\/Model\/Plugin\/CodeAttributeExtension.php'
on line 25


texts: How to save custom option field value when create order programmatically?

texts:
I have been trying to create order programatically, it's working well except custom option.

I have one custom option which reference id is 435. I have tried the following. But it seems not working

$order->setData(array( 'options' => array(
     435 => $customvalue,
)));

I got above suggestion From here

How to save custom option field value when create order programatically?


texts:
I have couple of instances configured in my httpd file to run multiple magento store. Now problem has arise, i wanted to install new magento install but after setup, and going to either back end or front end. I am given 404 error, which wasn't helpful. so i ran

apachectl -t

and i got this error

  AH00558: httpd: Could not reliably determine the server's fully
  qualified domain name, using 192.168.0.10. Set the 'ServerName'
  directive globally to suppress this message Syntax OK

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/Applications/MAMP/htdocs/"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
    # allow fonts to be displayed on the blogs
    <FilesMatch ".(eot|ttf|otf|woff)">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>

    SetEnv MAGE_RUN_TYPE 'website'
    SetEnv MAGE_RUN_CODE 'alpha'
    SetEnv MAGE_SET_IS_DEVELOPER_MODE 1

    <Directory "/Applications/MAMP/htdocs/alpha/">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/Applications/MAMP/htdocs/beta"
    ServerName dev.beta.com
    ServerAlias dev.beta.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
    # allow fonts to be displayed on the blogs
    <FilesMatch ".(eot|ttf|otf|woff)">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>

    SetEnv MAGE_RUN_TYPE 'website'
    SetEnv MAGE_RUN_CODE 'go'
    SetEnv MAGE_SET_IS_DEVELOPER_MODE 1

    <Directory "/Applications/MAMP/htdocs/beta">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

I think i have lost the setting for default localhost and i tried to copy wrong way to reach localhost. What am i doing wrong?


texts:
I am encountering an issue when theming on Magento CLI 2.3.5-p1.
I want to customize the favicon.
During my first attempt I just drop a new icon on web folder and named it favicon.ico.
It works but only when I am on the customer login page (my theme inherits from blank). So that's the first issue : I want my icon to show on every pages.
Then I tried doing it with an image with custom name. It didn't worked at all. I don't know what to do I have followed EVERY tutorials.
Here is my theme arborescence :
|Violette
|-themeviolette
|---Magento_Theme
|-----layout
|-------default_head_blocks.xml
|-----web
|------favicon.ico
|---media
|---registration.php
|---theme.xml

My default_head_blocks.xml :
<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Magento_Theme::vio.ico" rel="icon" sizes="16x16" type="image/x-icon" />
    </head>
</page>

Thank you very much for saving me


texts: Magento2 need to create the download link in custom module

texts:
I have created the simple custom module in Magento2. Which show pages correctly now I need to create the link on that page which download the PDF file which is in module web folder.

 For Ex app\code\Magento\Hello\view\frontend\web\pdf\test.pdf

What should I do? DO I need to add the routing for new function if yes how I can do that currently my routing file is

  \app\code\Magento\Hello\etc\frontend\routes.xml

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

rest of the files are simple module files with no modification.

Please let me know where I need to write the download code for the link

Thank you.


texts: Looking to replace document.write(new Date().getFullYear() with an equivalent PHP function

texts:
I am looking for an equivalent PHP function to accomplish what document.write(new Date().getFullYear() is expected to do. This function is to be used in place of deprecated document.write(new Date().getFullYear()) in the footer section that you see in Magento Admin where HTML code can be placed for the footer text. Any advice or help greatly appreciated.Below is what I thought should have worked out.

COPYRIGHT © 2013-<?= date("Y"); ?> mymagentosite.COM. ALL RIGHTS RESERVED.


texts: Adding attribute to category and display category as per that attribute

texts:
Magento by default provide adding attribute to the products but not to the category.Is there any way to add attribute to the category? I would like to have attribute with input type- multiple select .

My question is explained in 2 parts.

Detail eg:

Part 1:
I have a player(category) called XYZ and it should have attribute like team name.
When i say multiple select it means,player can be part of different teams.So i will select lets say 3 team names.

so

player XYZ belongs to team A,B,C
player ABC belongs to team A,B
player PQR belongs to team B,C

Part 2:
Now i want to include this teams A,B,C in the menu(frontend) and

when i select team A ->  it will display all players who have team A (attribute) selected
Same for B,C.

Thank you


texts: I want to check if the customer logged in has had at least 1 order over €30 euro. What would be the best way to do this?


texts: Magento2: I need to change the position of custom mass action dropdown option in sales order grid

texts:
I need to change the position of custom mass action dropdown option in sales order grid
Please check screenshot:

Just need to show the Sync option to on top position before delete.
Does anyone have idea for the same?
Thanks in advance


texts: Product form in admin: adding a field in the basic area

texts:
I have added a custom attribute to the product entity. It is visible in the back-office, and the value is properly saved, it works fine.

However, using the .xml file, I would like to override the display (for exemple, for a select yes/no, I would like to use the built-in switch icon of Magento).
To do that, I have to add a xml file to my module, and write inside the data related to my field, in a specific fieldset.

The problem is here, I don't know the name of the basic (default) fieldset in the product form. I managed to do it in the category form, but not in the product one. Any Idea?


texts: Magento 2.x Theme Configuring page is loading infinity

texts:
I need help to solve the issue from maganto 2.x theme configuring. I was trying to Add my contents into my Theme Like, Header, Footer etc. but the theme page is loading infinity. Please check my screenshot below.

  Location: Content-->Configuration-->Themes

When I am trying to edit the theme the theme configure page is loading infinity.

I need help to resolve it. Please tell me the way to solve it.

Thanks in advance


texts: All upsells products are not showing on product view/details page

texts:
I am facing strange issue with usells products selected for a product.
I have selected 11 products as upsells out of one is disabled so total 10 products as in screen shot

 but in product view page it showing only 6 products.

I have tried following things to correct it

1 ) Ensure all products are set to enabled

2 ) Check that the products are set to In Stock or that they have manage stock set to "no"

3 ) Ensure products are set to visibility of "Catalog, Search"

4 ) Check that products are assigned to active categories

5 ) If on a multi store setup ensure that products are available on the store view you are reviewing

6 ) Go to System>Index Management select all re-index (you could reindex individually but reindexing it all won't hurt)

7 ) If you are running a 3rd party cache flush these as well. (note: most full page caches will not cache catalog/product pages)

Note: My application has 3 website and two store views, so I checked the website tab also

website tab screenshot:

Can anyone faced this kind of issue before. ?


texts: How do I hard code a link when I'm calling an attribute? I want the admin user to only enter a relative path but I have a value check if statement

texts:
How can I simplify this:

<?php echo $attribute = $_product->getResource()->getAttribute('pdf_download');
if ($attribute)
{
echo $attribute_value = $attribute ->getFrontend()>getValue($_product);
}
?>

Into something like this?

<a href="<?php echo $this->htmlEscape($_product->getTechpage()) ?>"><?php echo $this->__('Technical Documentation') ?>


texts:
I am in the process of migrating from an older Magento 1.7 to a Magento 2.1.5 webshop.

On the new one, after a very tricky database migration I have a weird occurrence of some products being on sale, that weren't on sale in the old webshop.

See the below links for examples, the first link is to the older webshop where the products are shown with the correct price, the second link is to the new shop where the products have been put on sale.

Old Webshop

New Webshop

Now I have no listings in my Catalog Price rules and Cart Price rules on my new shop, I though maybe it would be here that these sale prices are being set but it does not seem like it.

On the old shop, there are some Catalog Price Rules, so I'm thinking that during the migration of the product database might have brought some sale settings with it, I only wanted to migrate the product catalog, not sales history etc.

Could it be in the database where I will find the reason why these items that are being put on sale? I do have phpMyAdmin access and can edit the database directly if needed.


texts: Magento 2: Payment Gateway error, Sorry, but something went wrong. Please contact the seller. Issue (Authorized.net)

texts:
I got an error on payment gateway in magento 2, Sorry, but something went wrong. Please contact the seller(Authorized.net),
I am using the sandbox account for authorized.net.

Got the same error like mentioned in this question:
Sorry, but something went wrong. Please contact the seller. Issue : when checkout with credit card (Authorized.net) - Magento-2.1.2

I also changed the time in 60 in this
Magento\Authorizenet\Model\TransactionService CONNECTION_TIMEOUT

and also my cache is enabled.

  Note: I am running project on localhost, if this is the reason for
  that?

please suggest a solution.


texts:
Just wondering if it is possible to change the 'Estimate Shipping and Tax' function in the cart to only show the Country. We plan on doing flat rate shipping based on countries, so for the estimate function, so we only need the Country drop down..

In the latest Magento version (1.9.x) is there a quick and easy way to disable/remove the 'State/Province' and 'Zip/Postal Code' options in the Shipping Estimator?

I can't disable them completely however as they are needed in the customer details when purchases are actually made...

Anyone got any idea's that might point me in the right direction?


texts: Magento 2: requirejs-config.js in themes?

texts:
Is it possible to include a requirejs-config.js file (or otherwise configure RequireJS) via a Magento theme?  Or is the capability reserved for Magento modules?  The dev docs information on theme structure is ambiguous to this point.

Dev docs doesn't mention anything about RequireJS -- however, themes do include a web which means javascript can be bundled with them.  If javascript can be bundled with a theme, that means a RequireJS module can be bundled with a theme, and if a RequireJS module can be bundled with a theme that module may requires a specific RequireJS configuration.

My naive assumption would be themes would have this capability, but I haven't been able to find any documentation on this one way or the other, and haven't an afternoon free to spend doing the required code spelunking on Magento's requirejs-config.js file including.


texts:
I have inventory module which is a grid and is showing in admin panel
this module is under catalog tab I created role inventory and this role should see just the module
in etc folder config.xml I wrote the acl as follow:

 <acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <catalog>
        <children>
                <inventory>
                    <title>Inventory</title>
                           <children>
                                <inventory translate="inventory" module="inventory">
                                    <title>Lenmar US</title>
                                    <sort_order>0</sort_order>
                                </inventory>

                            </children>

                </inventory>
                </children>
                </catalog></children>
        </admin>
    </resources>
</acl>

more over in controller I have this for allow:

    class Lenmar_Inventory_Adminhtml_InventoryController extends Mage_Adminhtml_Controller_action
    {
    protected function _isAllowed()
        {
            return Mage::getSingleton('admin/session')->isAllowed('inventory/inventory');
        }
//continued

in role resources I can see that the inventory  is under the catalog and when I choose the inventory the catalog will be chosen
but I have access denied when going to user with that role


texts:
I'm trying to change "Excl. Tax:" to "Excl. Vat:" and have created a CSV file called en_GB.csv which contains the line - "Tax:", "Vat:".

I've saved and uploaded this to app/design/frontend/Magento/luma/i18n/en_GB.csv.
The translation hasn't worked as my store still shows "Excl. Tax".
I've deployed static files and run the upgrade command too.
Not too sure what to try next?


texts: Magento 2 : Error The element 'product.info.main' already has a child

texts:
I am just working to make my Magento site run faster and I'm seeing a lot of repeated rows in my Magento2.2.2 exception.log file that says the below.

However, I'm not sure how to fix it.

Wondering if anyone can explain better what it means.

I have a theme I purchased and then created a child theme of the purchased theme .So, I can edit the phtml and css files to customize the theme.

main.CRITICAL: The element 'product.info.main' already has a child with alias 'other' {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0)


texts:
Is there a way, to clone all products ?

I would like to create new SKU in the process and disable all cloned products for one store view.

I am willing to do this with PHP or MYSQL.


texts: Magento 2 - How can I show specific products on homepage

texts: I am trying to find a way to show specific products (that I will select from the admin area) in Homepage. I see there is a widget for products from a specific category but there is none for selecting products and showing them. I thought about creating a widget but I am not sure on how to show the products on the admin area. Could you please help me show specific products on homepage?


texts: Anyone managed to upgrade to EE 1.13 and keep the old urls in place?

texts:
we tried an upgrade to 1.13.1.x for an existing site. One of the requirements is to keep the old urls or at least do 301 redirects to the new ones. The site has duplicate category url keys in different parts of the tree (a/foo and b/foo) and multiple websites, so some categories have the same name under different domains (i.e. domain1.com/foo and domain2.com/bar). While this worked fine for previous versions, it looks like now the category url keys need to be unique. Even with the latest patches provided by Magento, the url keys still get numbers attached to them and lose the parent path, a/foo becoming foo and b/foo becoming foo-1. For the default store view, the old urls still work if accessed directly, but for the other stores they throw 404s.

I know that since this is about EE support is the best place to go and we did that, but I was wondering if anyone else stumbled upon this and got it working or at least got some insights on a possible fix.


texts: White screen on frontend after bin/magento setup:upgrade

texts:
I have a strange problem - I get a white screen on the frontend (backend is ok) after running the command: php bin/magento setup:upgrade
I have test Magento 2.3.5 system on which I have previously installed new extensions/modules without any problems. I added in a module derived from tutorial by a well known extension provider then went through the procedure of:
php bin/magento module:enable Module_Name
php bin/magento setup:upgrade
The module worked on the backend in that it added a column to the Sales grid as planned but then I noticed a blank screen on the frontend. PHP memory_limit is set to 756M so that shouldn't be the problem.
I kept restoring from backup and trying things and in the end straight after restoring tried just the setup:upgrade command with no new module in place and got the white screen so it was nothing to do with the module.
So have working website then do php bin/magento setup:upgrade then white screen.
Any ideas anyone?


texts: Quantity increment decrements not working for grouped product magento 2

texts:
As a test I created 3 simple products and associated them with a grouped product.

I enabled qty increments for the grouped product and set the allowed increment.

The system allows you to add product quantities to the cart that do not meet the increment rule.

I also tested this with a configurable product (using the same 3 simples) and in this case it worked as expected.

Does anyone know if this is a known issue? Or if there are any work arounds for it?

IS there any configuration need to be done for his through admin panel?


texts: Magento Container not working in custom layout

texts:
I have created a custom XML layout page that I will be using for my home page. Right now it is a clone of the normal 1column.xml layout, and I'm trying to add a container for an image slider.

Here is the code I have added to my layout file (home_page.xml):

<container name="slider.container" htmlTag="div" htmlId="slider.container" htmlClass="slider-container" before="page.top"/>

This should in theory produce the following HTML code on the home page:

<div class="slider-container" id="slider.container"> </div>

However, absolutely nothing is happening. I cannot find the container when inspecting all of the elements on the page with the F12 console. I have also added some test CCS to "slider-container" just to be sure, and absolutely nothing is showing.

My custom XML layout page should be working fine. If I remove the footer or header container from the layout file, and flush the cache, they disappear from the page as they should. This tells me that everything is set up and working correctly, but something isn't working correctly within the file.


texts: Cancelling order placement before order object is created from quote

texts:
I would like to hook up to an event that fires when a customer clicks on the button "Place Order", do some validations and then decide whether to proceed with checkout (and payment) or not. If not, I'd like to cancel the order placement, but keep the items in the cart (quote hasn't been converted to order yet) and throw a message like "Your order could not be processed".

I hooked to the checkout_submit_all_after event, which fires when I click on the button. I raised an exception and just got a browser alert "undefined" and remained in the page. I checked my account and the order was placed. So I added this:

$order->cancel()->save();

This cancels the order so that it is not placed, but the cart is emptied and I get no feed back on what went wrong during checkout. Instead I'm redirected to the cart page with the message "No items in your cart".

tldr: I want to be able to validate an order before saving it, so that it can be cancelled displaying a message similar to the one that appears when the payment method fails ("Your order could not be processed").


texts:
I am working in magento1.7.

In the customer registration form when I give password and confirm password and submit the form the page gets refreshes and following error shows...

  The password cannot be empty.   Please make sure your passwords match.

I am new to Magento, so please help me how to correct this error ?


texts: https to http change url through .htaccess in magento sites except checkout or my account page

texts:
All my pages are indexed with https: URL in Google because in the past my my secure base URL and unsecure base URL both were https://www.example.com
Now my secure base URL is https://www.example.com
an unsecure base URL is http://www.example.com
Such that checkout and customer pages open with https://www.example.com
and all other pages open with http://www.example.com
Issue:
As my all page are indexed as https in Google, I want to redirect https non checkout and non customer URLs to http
I tried with this .htaccess code, without success:
RewriteEngine on
# From https to http
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/
#RewriteCond %{REQUEST_URI} !^/customer/account/
#RewriteCond %{REQUEST_URI} !^/checkout/multishipping/login/
#RewriteCond %{REQUEST_URI} !^/wishlist/
#RewriteCond %{REQUEST_URI} !^/index.php/admin/dashboard/index/key/
#RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

# From http to https
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/checkout/cart/ [OR]
RewriteCond %{REQUEST_URI} ^/customer/account/ [OR]
RewriteCond %{REQUEST_URI} ^/checkout/multishipping/login/ [OR]
RewriteCond %{REQUEST_URI} ^/wishlist/ [OR]
RewriteCond %{REQUEST_URI} ^/index.php/admin/dashboard/index/key/
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]


texts: Give the option in admin to change custom module route on frontend

texts:
Say on frontend your main module page is www.website/test/

etc/frontend/routes.xml:

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

In the admin I've built a list of settings. Among those I would like to give the option to change "test" into something else.

So, depending on client's needs, he can change that link.

How would I go about doing that? Just some general hints would be really helpfull.

Thanks!


texts: Magento 2: Error coming from Iteraror.php when trying to access Store=>Configuration

texts:
When I attempt to access my store's configuration, I get this error:
1 exception(s):
Exception #0 (Exception): Notice: Undefined index: id in /home/vs1paymentb/public_html/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php on line 63

There's more to the error after that but it's too long to paste here. Does anyone know what could be causing this error and how to fix it?
The only extension currently installed is this:
https://ecommerce.makarovsoft.com/magento-direct-add-to-cart-and-checkout-link-for-magento-2.html

Can anyone help me to resolve this issue?
Thanks in advance..!


texts:
I am working on a site that has, I believe 9 separate Magento instances, same site.

Therefore there are strict procedures surrounding any back-end data - config and even for CMS blocks.

I would like to find out how to add a CMS block via a setup script.


texts: Error add new block into block Magento 2

texts:
I'm using Magento 2.3.4 and t tried to append a block to another block like this in my controller:

            $category_list_subcategories = $resultPage->getLayout()->getBlock('promotion.view.subcategories.wrapper');
            $catIdx = 0;
            if ($category_list_subcategories){
                foreach ($childCategories as $childCategory){
                    $catIdx++;
                    $subcategoryBlock = $this->layoutFactory->create()->createBlock('Vendor\Module\Block\View\Subcategory');
                    $childCategory = $this->categoryFactory->create()
                        ->setStoreId($this->helper->getStoreId())
                        ->load($childCategory->getId());
                    if (!$this->categoryHelper->canShow($childCategory)) {
                        continue;
                    }
                    $subcategoryBlock->setData('current_category', $childCategory);
                    $subcategoryBlock->setData('cat_index', $catIdx);

                    $subcategoryBlock->setData('parent_landing_is_hide_lang', $category->getData('landing_is_hide_lang'));
                    $subcategoryBlock->setData('parent_landing_sort_by_price', $category->getData('landing_sort_by_price'));
                    $subcategoryBlock->setData('parent_landing_sort_by_name', $category->getData('landing_sort_by_name'));

                    $category_list_subcategories->append($subcategoryBlock); //this line causes an error

                }
            }

my layout XML:

<?xml version="1.0" ?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Vendor\Module\Block\View\Index" name="promotion.view.categories" template="Vendor_Module::view/index.phtml">
                <block class="Magento\Framework\View\Element\Template" name="promotion.view.subcategories.wrapper"/>
            </block>
        </referenceContainer>
    </body>
</page>

but when i tried to access the page i got this following error:

  Exception #0 (OutOfBoundsException): The element with the
  "view\subcategory_0" ID wasn't found. Verify the ID and try again.


texts: Magento2 : Order Success Observer For Admin Order

texts: Does anyone know how to call observer for admin order success?


texts: Adding text to swatch area on product pages?

texts:
I'd like to add text below each attribute on the product options form section of the product page.

So, for example, something like:

Size
[s][m]
Appended text here

I can tell this is directly related to /module-swatches/view/frontend/templates/product/view/renderer.phtml, but the stuff I'd like to edit is generated by this js:

<script type="text/x-magento-init">
    {
        "[data-role=swatch-options]": {
            "Magento_Swatches/js/swatch-renderer": {
                "jsonConfig": <?= /* @escapeNotVerified */ $swatchOptions = $block->getJsonConfig() ?>,
                "jsonSwatchConfig": <?php /* @noEscape */ echo $block->getJsonSwatchConfig(); ?>,
                "mediaCallback": "<?= /* @escapeNotVerified */ $block->getMediaCallback() ?>",
                "gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
                    'Magento_ConfigurableProduct') ?: 'replace'; ?>"
            },
            "Magento_Swatches/js/configurable-customer-data": {
                    "swatchOptions": <?php /* @noEscape */ echo $swatchOptions ?>
            }
        }
    }
</script>

Any thoughts?


texts: Magento2: How to uncheck "Use Default Value" for description

texts:
I need to uncheck for all products description in one time "Use Default Value" for specific store.

In products --> Catalog I can switch store view example from default store view to English and then edit product and then in description uncheck "Use Default Value".

In single product I can switch store view:

and then uncheck:

But for above 11k products take more time. Any one know how to uncheck for all products description in one time?


texts: Magento 2: How to Specify "Semantic Versioning" Dependencies in my Module's composer.json

texts:
Magento 2's development and deployment includes a formal process for versioning, where major and minor versions of core Magento modules will be bumped up based on changes in backwards compatible features.

How should I, as a Magento module developer, build a list of requirements in my own composer.json file?  Do I need to manually look at my module everytime I use a piece of core Magento code and add a require:... line to composer.json?  Or is there an automated tool that can do that for me?

How do I specify a version to include in my composer.json?  Should it be the specific module version I've developed against?  Or should there me some sort of wildcard involved?  Or do I need to make a decision based on tradeoffs?  If so, what are the tradeoffs involved for each style of version specifying?

There's a lot of high level descriptions of this feature floating around out there -- but it's very unclear what practical steps a working developer should take here, and/or what the actual consequences of those steps are.


texts: Magento 2 controller execute only executing once when cache enabled

texts:
class World extends \Magento\Framework\App\Action\Action
{
    protected $logger;
    public function __construct(Context $context, \Psr\Log\LoggerInterface $logger)
    {
         $this->logger = $logger;
        return parent::__construct($context);
    }
     public function execute()
    {
          $this->logger->addDebug("TEST");
    }
}

In Magento 1 the controller action executes always when we go to the corresponding url. But in magento 2 "Test" gets logged only when i clear my cache and go to the controller url otherwise it doesn't. How can i add it to a controller in magento 2 so that it will keep on executing the code when i go to the corresponding url, without clearing the cache, like magento 1.


texts: How to filter category with custom attribute Magento 2

texts:
I added a custom category attribute type yes/no like this:

In eav_attribute table:

the problem is when i filter follow this attribute it return empty array:
$model = $this->categoryFactory->create();
$categories = $model->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('show_category', 1)
->addIsActiveFilter();

Any help? Thank in advance


texts: How to use rest API in magento 2 I search a lot but could not find a solution

texts: I searched on the web but could not find any solution how to use rest API in magento2 please guide me.


texts:
After spending quite some time analyzing magento's tax system, I finally came to the conclusion that Magento and I do not have a common understanding on how to calculate/display taxes in my particular configuration properly.

I've configured my Magento 1.8.1 CE edition as follows:

Catalog prices: including tax
Tax calculation Method based on: totals
Shipping price: Excluding tax
Apply custom tax: After discount
Apply discount on prices: Excluding tax
Apply tax on: individual product

Delivery for my shop is setup to 10 € excl. VAT

In addition I've setup a discount for all products+delivery of 10%

So that's the setup. Now here's my concrete problem with the tax calculation

I have the following product in my shopping cart:

Product "Banana" 13,90 € incl. 20% VAT (=2,32€)

Now on my checkout-page this adds up to the following picture

Banana (excl. VAT) 11,58 €
-Discount (10%) 1,16 €
+Delivery (excl. VAT) 10,00 €
= Grand total excl. Tax 20,42 € (-> so far so good!)
Tax 4,12 € (-> wrong? 2,08 € of discounted banana + 2 € of delivery = 4,08 €!)
= Grand total incl. Tax 24,74 € (consequently wrong too)

I have absolutely no idea how Magento can come up with those numbers and so far have not found any solution for this (and no bug report) as well. Does anyone has an idea on how I can fix that or whats wrong with my calculation/understanding of Magento?

Thanks for your help!!

Roland