texts: Magento 2 Delete All Categories from Database

texts:
I want to delete all categories from the database so I can import new ones.  I need to also delete the rewrites.  I tried this code:

  SET FOREIGN_KEY_CHECKS = 0;

  TRUNCATE TABLE r5t_catalog_category_entity;

  TRUNCATE TABLE r5t_catalog_category_entity_datetime;

  TRUNCATE TABLE r5t_catalog_category_entity_decimal;   TRUNCATE TABLE
  r5t_catalog_category_entity_int;   TRUNCATE TABLE
  r5t_catalog_category_entity_text;   TRUNCATE TABLE
  r5t_catalog_category_entity_varchar;   TRUNCATE TABLE
  r5t_catalog_category_product;   TRUNCATE TABLE
  r5t_catalog_category_product_index;

  INSERT INTO r5t_catalog_category_entity (entity_id,
  attribute_set_id, parent_id, created_at, updated_at, path,
  position, level, children_count) VALUES ('1', '0', '0',
  CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '1', '0', '0', '1'), ('2', '3',
  '1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '1/2', '1', '1', '0');

  INSERT INTO r5t_catalog_category_entity_int (value_id,
  attribute_id, store_id, entity_id, value) VALUES  ('1', '69',
  '0', '1', '1'), ('2', '46', '0', '2', '1'), ('3', '69', '0', '2',
  '1');

  INSERT INTO r5t_catalog_category_entity_varchar (value_id,
  attribute_id, store_id, entity_id, value) VALUES  ('1', '45',
  '0', '1', 'Root Catalog'), ('2', '45', '0', '2', 'Default Category');

  DELETE FROM r5t_url_rewrite WHERE entity_type = 'category';

  SET FOREIGN_KEY_CHECKS = 1;

And I get an error:

1701 - Cannot truncate a table referenced in a foreign key constraint (`xxxxxx_maged`.`r5t_catalog_category_entity_decimal`, CONSTRAINT `R5T_CAT_CTGR_ENTT_DEC_ENTT_ID_R5T_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `matt6vr_maged`.`r5t_catalog_ca)

When I uncheck ‘Enable Foreign Key Checks’ and the tables deleted but I then couldn’t import the categories.

Thanks!
Stan

UPDATE:
I ran the commands from the mysql prompt and didn't get any errors.  But now when I try to import categories I get this in the admin:

ROW: 67 ERROR: Unique constraint violation found

Thought's?


texts: Magento1.9.4: Images Not Uploading in Admin – JSON in Syntax Error

texts:
I am trying to upload an image - something which I have done a hundred times. Now it gets stuck with "uploading..." showing.

I have tried disabling extensions.
I haven't made any changes.
There have been no updates.
The images is 1.00mMb
I have checked for existing zero sized images
I have tried multiple browsers
I have reindexed and cleared the cache
I have tried incognito mode

The Error I get in console is:

Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at String.parseJSON [as evalJSON] (30fee76906a26cc4fffab3ed736897bb.js:720)
at klass.onFileSuccess (30fee76906a26cc4fffab3ed736897bb.js:22344)
at d.<anonymous> (30fee76906a26cc4fffab3ed736897bb.js:391)
at d.<anonymous> (30fee76906a26cc4fffab3ed736897bb.js:21540)
at k (30fee76906a26cc4fffab3ed736897bb.js:21540)
at d.fire (30fee76906a26cc4fffab3ed736897bb.js:21540)
at e.chunkEvent (30fee76906a26cc4fffab3ed736897bb.js:21540)
at f.event (30fee76906a26cc4fffab3ed736897bb.js:21540)
at XMLHttpRequest.doneHandler (30fee76906a26cc4fffab3ed736897bb.js:21540)

For some reason, The strings "anonymous" is being parsed which is creating an error. I'm not sure the problem is specific to the uploader.


texts: Why is the product quantity in Magento 2.3 actually zero?

texts:
I set the version of my product to a positive number, but when I go to the product page in frontend it's quantity is zero. Can anyone explain why? You can see it underlined in red in the following image:

My Magento version is 2.3.0


texts: Ajax Cart Does NOT work with Full Page HTTPS (SSL)

texts:
I turned on Full Page https, so all pages load only in HTTPS. Now I realized that AJAX cart throws error window when I try to add somethign to the cart.

Any ideas where to look for the cause? I can post scrips if necessary.


texts: Magento 2 REST get all Orders with admin token. CustomerID?

texts:
When I try to get all orders of my store...
Similar to this one: Magento2: REST API GET all Orders
I receive this message:
message: Does not exist the entity with %fieldName = %fieldValue",
    "parameters": {
        "fieldName": "customerId",
        "fieldValue": null
    }
}

How I get all orders??


texts: Programatically add cross sell products to all products within a certain category

texts: I'm not sure if this is even possible but say for example i have a category called X with 100 products in it, can i add say 3 products to all them 100 products in that particular category without manually going through every single product selecting which product(s) i would like to cross sell.


texts: What event is called when an admin user is deleted

texts: I want to call an observer function whenever an admin user is deleted. Could please tell me if there is any event called?


texts: how i can get product id on cj dropshipping?

texts: I would like to know how to get the product id on CJ dropshipping. I am having difficulty understanding what the product id number is that I have to import into my dropshipping store via CJdropshipping. Could anyone help me?


texts: How does shared checkout behave with multiple store domains?

texts:
We're setting up Magento to run 1 website and 3 stores each with 1 store view.  Each store view is associated with a different domain.  Since the 3 stores are part of 1 website, the catalog will be shared between the 3 stores, as well as the checkout (ie: if you add a product in store 1 you can checkout with that product in store 2).  However, the look and feel of these stores is totally different.

The question I have is, since the checkout is shared, will Magento try to redirect from store 2 and 3 to store 1 to complete the checkout?  Or even though the checkouts are shared, will pressing checkout on store 2 complete the checkout using store 2's domain and templates, likewise pressing checkout on store 3 will complete the checkout using store 3's domain and template?

Thanks.


texts: use different css classes for different custom option values

texts:
When i inspect Custom option values which are displaying in product view page , i got below code is reason to display those values.

code :

<span id="options-<?php echo $_option->getId() ?>-container">

inspect element :

here, is there any chance we can display different color for different custom option values, for example, Black = > Black, Green = > Green .

can we use different css classes or ids for each value ?

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

        <?php echo $this->getValuesHtml() ?>
        <?php if ($_option->getIsRequire()): ?>
            <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_RADIO || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX): ?>
                <span id="options-<?php echo $_option->getId() ?>-container">
            <?php endif; ?>
        <?php endif;?>


texts: Call 3rd party rest api with basic auth username and password

texts:
I am calling 3rd party API in my postman I have choose Authorization as basic auth and passing username and password.
I am using Zend Client in magento 2 to send request now bt I set headers like this as basic auth it is throwing me error as : Authorization error because I havent passed username and password in basic auth
Can anyone tell me how to pass that in magento 2 while calling api
Here is my code:
public function __construct(
        Context $context,
        \Zend\Http\Client $zendClient
    ) {
        parent::__construct($context);
        $this->zendClient = $zendClient;
    }

$this->zendClient->setHeaders([
                'Authorization' => 'Basic Auth AC687732356d7cc641b4**username a9bfa6d5f473db2e346e1*pwd***',
            ]);


texts: Magento 2 product visible on backend only

texts:
I have a few products that are mainly used for partner orders and should not be on visible on frontend. But visible on backend order creations!

In other words an internal product.

I'm only looking for directions here. Thanks.


texts:
In my login page. In button I want remove type attribute,

<button type="submit" class="action login primary" name="send" id="send2">

button type="submit" and want add onclick="custommethod()".

And in That custommethod() javascript function I want call existing Validation of magento2.

How can I achieve this?


texts:
My magento is 2.2.2 and I found that I have "ar_SA" language package installed in my site!

To uninstall it, Can I run this command?

php bin/magento i18n:uninstall ar_SA


texts: How do i call a controller function in ajax?

texts:
This is the content of my .../template/exportdb/attributes.phtml file:

Generate

This is my controller file:

<?php
class Attin_Exportdb_Adminhtml_AttributesController extends Mage_Adminhtml_Controller_Action{

    public function IndexAction() {

        $this->loadLayout();
        $this->getLayout()->getBlock("head")->setTitle($this->__("Export Attributes"));

        //$this->getLayout()->createBlock('exportdb/adminhtml_attributes');
        //$this->getLayout()->getBlock("exportdb/adminhtml_attributes");

        $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','attributes_exp_db',array('template' => 'exportdb/attributes.phtml'));
        $this->getLayout()->getBlock('content')->append($block);

        $this->renderLayout();

    }
    public function AjaxAction(){
        echo "ajax";
    }
}

This is the config.xml content:

<?xml version="1.0"?>
<config>
    <modules>
        <Attin_Exportdb>
            <version>0.1.0</version>
        </Attin_Exportdb>
    </modules>
    <global>
        <helpers>
            <exportdb>
                <class>Attin_Exportdb_Helper</class>
            </exportdb>
        </helpers>
        <blocks>
            <exportdb>
                <class>Attin_Exportdb_Block</class>
            </exportdb>
        </blocks>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <attin_exportdb before="Mage_Adminhtml">Attin_Exportdb_Adminhtml</attin_exportdb>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

But the firebug show me the 404, I don't get to Attibutes_ajaxAction function. Why?

The result:


texts: Looking for Magento2 compatible Developer-Debug tool, which can be downloaded for free?

texts: Please brief on the features of extension. Besides this, mention the installation process or the steps involved for enabling the module.


texts: Can I store a custom variable in a quote? (temporarily) M1.9.2.4

texts:
In Magento, can I store a custom variable in a quote? (temporarily)

We use an observer for quote item ... but I need to store a variable in the qupte to use later .... this cannot be used sales/session of customer/session - must be in quote

help appreciated


texts: Magento2. Serialize file doest not exists in Magento 2.1.16 version

texts:
I just complete my module n I was trying to test my module on different versions my module was working perfectly on 2.2.7 and 2.3.0 versions but when I tried on 2.1.16 then it gives me the error

  Error filtering template: Class Magento\Framework\Serialize\Serializer\Json does not exist

How can I solve this error n what is the reason behind this error


texts:
Add multiple products to cart using Magento2 REST API using custom method
Their is no default magento api
this is single product add to cart json code in rest api body section.

{ "cartItem":
   {
     "quote_id": "ee6e72fc6e3226558197d23cb1f88cbe",
     "sku": "24-MB02",
     "qty": 1
   }
}

i am trying to modify the above code to bellow format and did respected changes in webapi.xml, inteface and model

{ "cartItem":
  [
   {
     "quote_id": "ee6e72fc6e3226558197d23cb1f88cbe",
     "sku": "24-MB02",
     "qty": 1
   },
  {
    "quote_id": "ee6e72fc6e3226558197d23cb1f88cbe",
    "sku": "24-MB03",
    "qty": 2
   }
 ]
}

vendor/magento/module-quote/etc/webapi.xml

<route url="/V1/guest-cart/:cartId/item" method="POST">
    <service class="Magento\Quote\Api\GuestCartItemRepositoryInterface" method="saveData"/>
    <resources>
        <resource ref="anonymous" />
    </resources>
</route>

vendor/magento/module-quote/Api/GuestCartItemRepositoryInterface.php

    public function saveData(\Magento\Quote\Api\Data\CartItemInterface $cartItem);

vendor/magento/module-quote/Model/GuestCart/GuestCartItemRepository.php

in model i am stuck

public function saveData(\Magento\Quote\Api\Data\CartItemInterface $cartItem)
{
    /** @var $quoteIdMask QuoteIdMask */
    $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartItem->getQuoteId(), 'masked_id');
    $cartItem->setQuoteId($quoteIdMask->getQuoteId());
    return $this->repository->save($cartItem);
}

is it possible
Can any one please hlep me,
Thanks.


texts: How to remove custom my account page link in left panel in magento 2?

texts:
I have a custom module.I created the my account page menu and page.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="customer_account_navigation">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-rewardpoints-link" after="-">
            <arguments>
                <argument name="path" xsi:type="string">rewardpoints</argument>
                <argument name="label" xsi:type="string">My Reward Points</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

I want to to show the menu when the module is enable from the back end.

$enable = $this->helper('Eight25media\Rewardpoints\Helper\Data')->getGeneralConfig('rrpoints/enable');

I can check from my controller to remove the page but my question is how to remove in my account page left side menu section?.


texts: Error : Patch can't be applied SUPEE-5344 (hunk errors)

texts:
I was trying to apply SUPEE-5344 patch to Magento but getting following error. I don't understand. Is the patch already there ? If yes then why does Magento gives messages to apply the patches

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Admin/Model/Observer.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file app/code/core/Mage/Admin/Model/Observer.php.rej
patching file app/code/core/Mage/Core/Controller/Request/Http.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file app/code/core/Mage/Core/Controller/Request/Http.php.rej
patching file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php.rej
patching file app/code/core/Mage/XmlConnect/Model/Observer.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file app/code/core/Mage/XmlConnect/Model/Observer.php.rej
patching file lib/Varien/Db/Adapter/Pdo/Mysql.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file lib/Varien/Db/Adapter/Pdo/Mysql.php.rej


texts: Magento Order Shipment Email not sending - Instead we are sending the Shipment Update Email

texts:
We are using laravel to send our orders to and from our warehouse using the Magento API.

I am having issues sending the Order Shipment email, instead, the customers are getting the "Order Update" email that says their order is complete.

The code below add the comment into the comment history and says the customer was "Notified" but the email is not going out.

Any ideas?

try {
    $shipment = $client->call('sales_order_shipment.create', ["orderIncrementId" => $data->channel_order_code]);

    if (strlen($data->tracking) > 12) {
        $client->call('sales_order_shipment.addTrack', ['shipmentIncrementId' => $shipment, 'carrier' => "usps", 'title' => $data->channel, 'trackNumber' => $data->tracking]);
    } else {
        $client->call('sales_order_shipment.addTrack', ['shipmentIncrementId' => $shipment, 'carrier' => "fedex", 'title' => $data->channel, 'trackNumber' => $data->tracking]);
    }
    try{
        $client->call('order_shipment.addComment', ['shipmentIncrementId' => $shipment,'comment' => 'Your order has shipped with tracking number '.$data->tracking, 'email' => true]);
    }
    catch(\Exception $e)
    {


texts: Magento 1: How do I identify products (simple and their parents) that have not been sold for say "1 year" or "2 years"?

texts:
In an effort to clean up Magento 1 and the bloating product database we decided to list products that were addded before day x and havent been sold since 365 days
Question: is there an easy way to find these products? Or do we need a query?
(the idea is to select these simple products + ther parents ... and set status = disabled)
thx
help appreciated


texts: What does `visitor_id` is NULL at `report_viewed_product_index` mean?

texts:
For example there are the rows at report_viewed_product_index:

index_id    visitor_id  customer_id product_id  store_id    added_at
19          NULL          20116     10642       2       2016-03-04
45          NULL          20162     6246        1       2016-03-05
108         NULL          15229     20157       1       2016-03-14
190         378345      NULL        21092       2       2016-03-30
191         381787      NULL        20184       1       2016-03-30

As I understand customer_id IS NULL means  that we have 'not logged customer' or visitor. What does visitor_id is NULL mean?


texts:
I install fresh magento 1.9.3.2 .

I tried to install Patch 10415 by creating following file on root named patch.php

<?php
print("<PRE>");
passthru("/bin/bash PATCH_SUPEE-10415_CE_1.9.3.2_v1-2017-11-28-06-38-23.sh");
print("</PRE>");
echo "Done";

?>

I also downloaded PATCH_SUPEE-10415_CE_1.9.3.2_v1-2017-11-28-06-38-23.sh file and placed on root.

The following error is displayed

  Checking if patch can be applied/reverted successfully...
      ERROR: Patch can't be applied/reverted successfully.

checking file app/Mage.php
checking file app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php
checking file app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php
checking file app/code/core/Mage/Adminhtml/Block/Review/Add.php
checking file app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php
checking file app/code/core/Mage/Adminhtml/Controller/Action.php
Hunk #1 FAILED at 186.
1 out of 1 hunk FAILED
checking file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php
Hunk #1 FAILED at 142.
1 out of 1 hunk FAILED
checking file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php
checking file app/code/core/Mage/Api/Helper/Data.php
checking file app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
checking file app/code/core/Mage/Api/Model/Wsdl/Config.php
checking file app/code/core/Mage/Api/Model/Wsdl/Config/Base.php
checking file app/code/core/Mage/Core/Helper/String.php
checking file app/code/core/Mage/Core/Model/File/Validator/Image.php
Hunk #1 FAILED at 91.
1 out of 1 hunk FAILED
checking file app/code/core/Mage/Core/etc/config.xml
Hunk #1 FAILED at 467.
1 out of 1 hunk FAILED
checking file app/code/core/Mage/Core/etc/system.xml
Hunk #1 succeeded at 673 (offset -1 lines).
Hunk #2 succeeded at 683 (offset -1 lines).
checking file app/code/core/Mage/Customer/Model/Customer.php
checking file app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php
checking file app/code/core/Mage/Log/Helper/Data.php
checking file app/code/core/Mage/Rule/Model/Abstract.php
checking file app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
checking file app/code/core/Zend/Form/Decorator/Form.php
checking file app/design/adminhtml/default/default/template/backup/dialogs.phtml
Hunk #1 FAILED at 158.
1 out of 1 hunk FAILED
checking file app/design/adminhtml/default/default/template/sales/billing/agreement/view/tab/info.phtml
checking file app/design/adminhtml/default/default/template/xmlconnect/edit/tab/content.phtml
checking file app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/image_edit.phtml
checking file app/locale/en_US/Mage_Adminhtml.csv
checking file app/locale/en_US/Mage_Customer.csv
checking file js/mage/adminhtml/backup.js
checking file lib/Varien/Filter/FormElementName.php
Done


texts: Magento 2 - jQuery validation custom error message

texts:
I have the following input that requires validation. When the remote method is failed, it displays an error message Please fix this field.. How can I customize this message?

<input type="text" data-validate="{required:true, email:true, remote:'/bonus-point/transfer/validateRecipientEmail'}" class="input-text" title="Recipient Email" value="" id="recipient_email" name="recipient_email" aria-required="true">


texts: Upgrade from 1.9.1.0 to 1.9.2.2 using Magento Connect Manager

texts: I want to upgrade from 1.9.1.0 to 1.9.2.2. When I go to the Magento Connect Manager, nothing shows up under Manage Existing Extension. I have verified all files and directories are writable. I am new to Magento and this will be the first time I have upgraded. Any help would be appreciated.


texts: TypeError: sections is undefined in section-config.js:50:30 Magento 2

texts:
I am getting this error TypeError: sections is undefined in section-config.js:50:30 in firefox but not in chrome.
I added

<referenceContainer name="content">
    <block name="customer.section.config" class="Magento\Customer\Block\SectionConfig"
           template="Magento_Customer::js/section-config.phtml"/>
    <block name="customer.customer.data"
           class="Magento\Customer\Block\CustomerData"
           template="Magento_Customer::js/customer-data.phtml"/>
</referenceContainer>

But still, I am getting that error. Please help me how to solve that.


texts: i want to add custom help text below custom attribute

texts:
I added a custom option, say ring size in my product. I want to add a custom help text that will open a PDF in a popup window.  Apparently I cannot use HTML in the title field.

Example:

need help ?


texts: Magento Extremely Slow When Cache "Full"

texts:
We are running Magento 1.9.2.1 with Lesti_Fpc on an adequately sized managed server. Initially, we used the default file cache, which was fine. But after the catalog grew (although I think ~8000 products is not too bad) and crawlers became more aggressive, the site became slow as soon as the cache was getting a bit bigger. When the cache was cleared, everything was running quick again.

We tried to switch to APC as a cache backend via the following entry in the local.xml:

<global>
    <cache>
        <backend>apc</backend>
        <prefix>MYSHOP_</prefix>
    </cache>
</global>

But this made the problems even worse. I then read that Cm_Cache_Backend_File is made for this problem and integrated it via:

<global>
    <cache>
        <backend>Cm_Cache_Backend_File</backend>
    </cache>
</global>

This feels a bit better, but the problem is still the same. To keep the cache small and tidy, I also integrated Aoe_CacheCleaner, but this also does not help. Still, as soon as the cache is cleared, everything is running quick again.

EDIT:
Based on the answer by infabo, I also activated Cm_Cache_Backend_File for the FPC with the file app/etc/fpc.xml and the following content:

<?xml version="1.0"?>
<config>
    <global>
        <fpc>
            <lifetime>86400</lifetime>
            <backend>Cm_Cache_Backend_File</backend>
        </fpc>
    </global>
</config>

I am sure this makes sense, but it also does not solve the problem.

I know that the general solution to this problem seems to be Redis (or maybe alternatively Memcached) as a cache backend, but unfortunately, it is not available on our managed server. Switching to another hosting company is not (yet) an option.

I investigated a lot now, but I do not have any more idea. Maybe anyone else can help?


texts: How do add a class to the Wishlist Link in the Top Menu?

texts:
I want to add a class to the wishlist link in the top menu.

In my app/design/frontend/default/abcd/layout/wishlist.xml, I have a reference:

<reference name="top.links">
    <block type="wishlist/links" name="wishlist_link" />
    <action method="addLinkBlock"><blockName>wishlist_link</blockName></action>
</reference>

I know you can add a class using the addLink method as described in this answer. However the addLinkBlock method only takes one blockName argument. So how can I add a class to the wishlist link in the top menu?


texts:
If a product is part of a shopping cart promotional rule e.g. BUY 3 FOR THE PRICE OF 2, I would like to display this label on the product view page.

Is this possible?


texts: Setting a block OR model variable from 'update layout xml' in CMS page

texts:
is  this possible?  I need to dynamically assign a variable used in a templates Model class.  This variable will be generated via a CMS page.  Below is the template and block in question.  How can I pass a dynamically assigned variable to it's model?

<reference name="content">
        <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml" ></block>
</reference>

If possible i'd like to assign a variable to this via the block and pass it to the model using session variables (if I cant access this variable from the block outright).

This is the location of the block i'd like to access this variable:

code/core/Mage/Catalog/Block/Layer/View.php

Of course, I will extend this later as it is core atm.


texts: How to pass options to column select while extending gird with ?

texts:
Im trying to pass options form my source file to a custom column grid:

<?php

class Vendor_Module_Model_Source_Order_Way
    extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
{

    /**
     * Retrieve all options array
     *
     * @return array
     */
    public function getAllOptions()
    {
        if (is_null($this->_options)) {
            $this->_options = [
                [
                    "label" => "Website",
                    "value" => 1
                ],
                [
                    "label" => "Phone",
                    "value" => 2
                ],
                [
                    "label" => "Email",
                    "value" => 3
                ],
            ];
        }

        return $this->_options;
    }

    /**
     * Retrieve option array
     *
     * @return array
     */
    public function getOptionArray()
    {
        $_options = [];
        foreach ($this->getAllOptions() as $option) {
            $_options[$option["value"]] = $option["label"];
        }

        return $_options;
    }

    /**
     * Get a text for option value
     *
     * @param string|integer $value
     * @return string
     */
    public function getOptionText($value)
    {
        $options = $this->getAllOptions();
        foreach ($options as $option) {
            if ($option["value"] == $value) {
                return $option["label"];
            }
        }

        return false;
    }

}

And I'm stuck in options tag. I don't know how to pass path to source file and method?

<?xml version="1.0"?>
<layout>
    <sales_order_grid_update_handle>
        <reference name="sales_order.grid">
            <action method="addColumnAfter">
                <columnId>order_way</columnId>
                <arguments>
                    <header>Way Method</header>
                    <index>order_way</index>
                    <type>options</type>
                    <options>...</options>
                </arguments>
                <after>status</after>
            </action>
        </reference>
    </sales_order_grid_update_handle>
    <adminhtml_sales_order_grid>
        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_grid>
    <adminhtml_sales_order_index>
        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_index>
</layout>


texts: How do I override a value from a magento 2 lib LESS mixin?

texts:
I have created my own theme using Blank Theme as it's base. In my theme, I have a file in web/css/source/_navigation.less As I understand, this file calls a mixin. .lib-main-navigation();which pulls everything that is included inside of it's definition at lib/web/css/source/lib/_navigation.less .
Inside this mixin, there is a value that is preventing my megamenu from functioning correctly.
.submenu {
  top: 0 !important;
  left: 100% !important;
}

How do I edit the value for that class in a way that does not touch the magento lib files? As I dont want to override the core magento files.


texts: Best Practice Multi Country with Bilingual Magento 1.9

texts:
Wondering how to attain this setup for magento?

I have these countries

Oman
Qatar
UAE
Saudi Arabia
Jordan

But Language should only be English and Arabic for all. In this case, products should only be English and Arabic. What's in my mind is to create 2 views for each country but this is a lot of work. Is there any easier way wherein I just need to create only 2 views but all countries will share these 2 views? Please see image.


texts: Magento2 Category thumbnail image not uploaded?

texts:
I want to create category thumbnail image  in magento2  after I upload image and save image is not save its show blank my controller

<?php

namespace Company\Categorylist\Controller\Adminhtml\Category\Thumbnailimage;

use Magento\Framework\Controller\ResultFactory;

/**
* Class Upload
*/
class Upload extends \Magento\Backend\App\Action
{
   /**
    * Image uploader
    *
    * @var \Magento\Catalog\Model\ImageUploader
    */
   protected $imageUploader;

   /**
    * Upload constructor.
    *
    * @param \Magento\Backend\App\Action\Context $context
    * @param \Magento\Catalog\Model\ImageUploader $imageUploader
    */
   public function __construct(
       \Magento\Backend\App\Action\Context $context,
       \Magento\Catalog\Model\ImageUploader $imageUploader
   ) {
       parent::__construct($context);
       $this->imageUploader = $imageUploader;
   }

   /**
    * Check admin permissions for this controller
    *
    * @return boolean
    */
   protected function _isAllowed()
   {
       return $this->_authorization->isAllowed('Magento_Catalog::categories');
   }

   /**
    * Upload file controller action
    *
    * @return \Magento\Framework\Controller\ResultInterface
    */
   public function execute()
   {
       try {
           $result = $this->imageUploader->saveFileToTmpDir('thumbnail');

           $result['cookie'] = [
               'name' => $this->_getSession()->getName(),
               'value' => $this->_getSession()->getSessionId(),
               'lifetime' => $this->_getSession()->getCookieLifetime(),
               'path' => $this->_getSession()->getCookiePath(),
               'domain' => $this->_getSession()->getCookieDomain(),
           ];
       } catch (\Exception $e) {
           $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()];
       }
       return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData($result);
   }
}

and my di.xml is

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Model\Category\DataProvider" type="Company\Categorylist\Model\Category\DataProvider" />
        <virtualType name="Magento\Catalog\CategoryImageUpload" type="Magento\Catalog\Model\ImageUploader">
        <arguments>
            <argument name="baseTmpPath" xsi:type="string">catalog/tmp/category</argument>
            <argument name="basePath" xsi:type="string">catalog/category</argument>
            <argument name="allowedExtensions" xsi:type="array">
                <item name="jpg" xsi:type="string">jpg</item>
                <item name="jpeg" xsi:type="string">jpeg</item>
                <item name="gif" xsi:type="string">gif</item>
                <item name="png" xsi:type="string">png</item>
            </argument>
        </arguments>
    </virtualType>
    <type name="Company\Categorylist\Controller\Adminhtml\Category\Thumbnailimage\Upload">
    <arguments>
        <argument name="imageUploader" xsi:type="object">Magento\Catalog\CategoryImageUpload</argument>
    </arguments>
</type>
</config>

please look my code and support to resolve this issue


texts: Transactional Emails: Delivery Address - Company Name missing

texts:
Whenever we send delivery confirmation emails to customers who have specified a company name in their shipping address, the company name won't show up in the email.

Quite a few customers then get back to us to make sure that the delivery address has been recorded properly.
Our shipping module receives all the correct info including the company name, now I would like to find out why this wouldn't work in our Transactional mails

The email template contains the following line:

{{var order.getShippingAddress().format(''html'')}}

Any hints?
Also, the configuration inside the backend didn't show anything unusual on the html template:

  {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend
   middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend
   suffix}} {{var suffix}}{{/depend}}

  {{depend dhlaccount}}{{var dhlaccount}} {{/depend}}

  {{depend company}}{{var company}} {{/depend}}

  {{if street1}}{{var street1}} {{/if}}

  {{depend street2}}{{var street2}} {{/depend}}

  {{depend street3}}{{var street3}}{{/depend}}

  {{depend street4}}{{var street4}}{{/depend}}

  {{if city}}{{var city}},  {{/if}}{{if region}}{{var region}},
  {{/if}}{{if postcode}}{{var postcode}}{{/if}}

  {{var country}}

  {{depend telephone}}T: {{var telephone}}{{/depend}} {{depend
  fax}}F: {{var fax}}{{/depend}}`

If I read this correctly, the company name should be displayed.


texts: Magento2 installation - Failed to set PHP CodeSniffer installed_paths Config

texts:
I am trying to install Magento2 using composer.
Getting codesniffer error and tried below steps to overcome the error but unfortunately it's not going away
STEP 1: Tried to install magento2
$ composer create-project --repository=https://repo.magento.com/magento/project-community-edition magento2

As you can see, the installation ended up with the error
Failed to set PHP CodeSniffer installed_paths Config
STEP 2:
so I tried to install the codesniffer using below command
$ composer global require "squizlabs/php_codesniffer=*"

successfully installed codesniffer as shown below

I removed the magento2 directory to start over again
$ rm -rf magento2

STEP 3: tried to install magento2 again
$ composer create-project --repository=https://repo.magento.com/magento/project-community-edition magento2

that still ended up with the same error

I tested the phpcs installation and there seems no issue with it


texts: Magento 2 - How to override module from vendor?

texts:
I try to change some "view" files from a module called Amasty_MegaMenu.

I installed the module via composer. It is located in vendor\amasty\mega-menu.

So I created app/code/Amasty/MegaMenu with these files:

app/code/Amasty/MegaMenu/registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Amasty_MegaMenu',
    __DIR__
);

and app\code\Amasty\MegaMenu\etc\module.xml

<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) 2020 Amasty (https://www.amasty.com)
 * @package Amasty_MegaMenu
 */
-->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Amasty_MegaMenu" setup_version="1.5.0">
        <sequence>
            <module name="Amasty_Base"/>
            <module name="Magento_Cms"/>
            <module name="Magento_Theme"/>
            <module name="Magento_CatalogWidget"/>
        </sequence>
    </module>
</config>

which I have copied from the original vendor module.

Then I added the files which I want to replace

app\code\Amasty\MegaMenu\view\base\web\css\source\module\_variables.less

app\code\Amasty\MegaMenu\view\base\web\css\source\module\_helpers.less

app\code\Amasty\MegaMenu\view\base\web\css\source\mkcss\ammenu.css

Then I executed php bin/magento setup:upgrade but I get:

  Autoload error: Module 'Amasty_MegaMenu' from
  '/home/company/redesign.company.com/app/code/Amasty/MegaMenu' has been
  already defined in
  '/home/company/redesign.company.de/vendor/amasty/mega-menu'.


texts:
Hi I am getting the below error

Autoload error: Module 'Mageplaza_Smtp' from '/home/goodwwdm/public_html/new/app                                                                                /code/Mageplaza/Smtp' has been already defined in '/home/goodwwdm/public_html/ne                                                                                w/vendor/mageplaza/module-smtp'.

how to resolve the error.
Thanks in advance


texts:
I need to remove a "OK" button from customer register/login modal pop up and can't find the template anywhere. I can find the login.phtml file, however, the footer modal is not there.

Working on Magento ver. 2.1.8 and a custom theme.

Can anyone direct me?

UPDATE:

Grep result:

[frontend]$ grep -rni "Magento_Ui/js/modal/alert" /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend
/microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Magento_Checkout/web/js/sidebar.js:11:    'Magento_Ui/js/modal/alert',
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/fancybox_loading@2x.gif: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/paneltool.css: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/fancybox_overlay.png: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/fancybox_sprite.png: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/fancybox_loading.gif: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/styles.css: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/jquery.fancybox.css: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket_child/Ves_Themesettings/web/css/fancybox_sprite@2x.png: No such file or directory
grep: /microcloud/domains/operm2/domains/domain.co.uk/http/app/design/frontend/Venustheme/cricket/Ves_Megamenu/web/css/styles.css: No such file or directory


texts:
I want to make my cart page uncacheable so i have added

<referenceContainer name="content">
      <block cacheable="false"/>
</referenceContainer>

in /Magento_Checkout/layout/checkout_cart_index.xml.

So how would i check if it working or i'm doing it right.


texts: Why Mage::getBaseUrl is returning Admin Custom URL?

texts:
In Magento 1.7.0.2 I have a custom URL and path for admin.

The custom path it was set up in local.xml

<admin> <routers> <adminhtml> <args> <frontName>

And the custom URL on admin System > Config > Advanced > Admin > Admin Base URL

After that, the following lines are inserted in DB:

'1236','default','0','admin/url/custom','http://admin.mydomain.com/'
'1239','default','0','admin/url/use_custom_path','0'
'1240','stores','0','web/secure/base_url','https://admin.mydomain.com/'
'1241','stores','0','web/unsecure/base_url','http://admin.mydomain.com/'

When I use  <?php echo Mage::getBaseUrl(); ?> is returning base URL for links of custom admin (http://admin.mydomain.com/index.php/)

Because of this behavior, it puts URL admin in the cart and checkout.


texts: How can I implement step-by-step checkout process for my magento mobile theme?

texts:
I have two themes (mobile and desktop) in the same store view.
Desktop theme uses onepage checkout process . But however I want to make a multi-step checkout process for the mobile theme only.
i.e. the browser has to load a new URL for each step

i.e. when user comes to the checkout page and fill up the billing address and submit the button, the page will reload and take to the delivery address page..so on.

So can it be possible having two types of checkout process in the same store view for two different theme ?

If it is possible then how can I achieve this ? Please suggest some step by step guide.


texts: Magento 1.9 - How to get OrderId & TotalOrderAmount from order successful page?

texts:
Here is my stamped tracking code,

<img src="//stamped.io/conversion_tracking.gif?sId=5967067hgtt78y&apiKey=3956785687857869756769hhuhyuhuy&orderId=##orderId##&orderAmount=##totalOrderAmount##&orderCurrency=INR" />

How to load magento variable ##orderId## & ##totalOrderAmount##?


texts:
I am using Magento 1.7. The namespace is called MasteringMagento with a module called example.

My index controller is like so:

class MasteringMagento_Example_IndexController extends Mage_Core_Controller_Front_Action {

    function indexAction()
    {
        $this->loadLayout();

        return $this->renderLayout();
    }

}

If inside the indexAction I put an echo statement for example, it works, but it won't display a .phtml file.

config.xml (inside app/code/local/MasteringMagento/example/etc

<?xml version ="1.0"?>
<!DOCTYPE config>

<config>

    <modules>
        <MasteringMagento_Example>
            <version>0.0.0</version>
        </MasteringMagento_Example>
    </modules>

    <global>
        <models>
            <example>
                <class>MasteringMagento_Example_Model</class>
            </example>
        </models>
        <blocks>
            <example>
                <class>MasteringMagento_Example_Block</class>
            </example>
        </blocks>
        <helpers>
            <example>
                <class>MasteringMagento_Example_Helper</class>
            </example>
        </helpers>
    </global>

    <frontend>
        <routers>
            <example>
                <use>standard</use>
                <args>
                    <frontName>example</frontName>
                    <module>MasteringMagento_Example</module>
                </args>
            </example>
        </routers>
        <layout>
            <updates>
                <example>
                    <file>example.xml</file>
                </example>
            </updates>
        </layout>
    </frontend>

</config>

example.xml (inside app/design/frontend/base/default/layout

<?xml version ="1.0"?>
<!DOCTYPE config>

<layout version="0.1.0">
    <example_index_index>
        <update handle="page_two_columns_right" />

        <reference name="content">
            <block type="core/template" template="example/welcome.phtml">
        </reference>
    </example_index_index>
</layout>

And I have a folder called example with a welcome.phtml file inside located in app/design/frontend/base/default/template

What am I missing?

EDIT:

If I remove

<reference name="content">
            <block type="core/template" template="example/welcome.phtml">
        </reference>

from example.xml

I get a blank content area, but if it's there I get the dog, the tags and newsletter update column, not sure if that makes a difference.


texts:
I am facing rounding issue in mini cart item price. I want to round price for mini cart item.But I am not sure from where it is coming? Please let me know where can I modify cart item price value.
Any help will be appreciated

I just need to change format. I don't want to change price. In my case price is coming like 100.01$ but instead of that I want to show as 100$ only.

Thanks in advance.


texts: Add customer orders count to orders grid

texts:
I'm trying to add customer total orders to orders grid in magento 1 admin. There is a lot of solutions already answered, but they all count orders only for registered customers and it is not working for guest orders.

I made my extension extending Mage_Adminhtml_Block_Sales_Order_Grid.

In my _prepareCollection() I have joined sales_flat_order table so I can add customer email to my sales_flat_order_grid collection:

protected function _prepareCollection() {

    $collection = Mage::getResourceModel($this->_getCollectionClass());

    // Custom code
    $collection->getSelect()->join(
        'sales_flat_order',
        'main_table.entity_id = sales_flat_order.entity_id',
        array('customer_email')
    );

    // Here I'm missing code to add column orders_count to my collection
    // with orders count by customer email address already joined to my collection

    $this->setCollection($collection);
    return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();

}

I have tried with this code but it only works for registered customers, for guests customer_id is NULL:

// Get orders count
$readAdapter = Mage::getSingleton('core/resource')->getConnection('core_read');
$select = $readAdapter->select()
        ->from('sales_flat_order_grid')
        ->columns(array('orders_count' => new Zend_Db_Expr('COUNT(*)'))
        )->group('customer_id');
$collection->getSelect()->joinLeft(
    array('orders_count' => new Zend_Db_Expr('('.$select.')')),
    'main_table.customer_id = orders_count.customer_id',
    array('orders_count.orders_count')
);
$collection->addFilterToMap('orders_count', 'orders_count.orders_count');

Hope somebody can help me with this problem.


texts: How to add a dropdown in Adminhtml Form Block, selecting data from a table referenced by foreign key?

texts:
I am new to the StackExchange and this is my first question, so take it easy with me, please. :)

I am following to the letter this tutorial here, learning how to list, create, update and delete resources in the database, using Adminhtml grid's and forms.

I was able to do all the tasks proposed by the tutorial and got it up and running.

But now I want to add a dropdown field to the form, in order to grab items from another table, linked by foreign key.

The question below is most likely what I need, except the fact it is grabbing the select data from an array:

How to add dropdown field for select custom option from admin?

Does anyone have an example on how to do the above, but grabbing the select data from a database table?


texts:
How do I get Netto(without tax) and Brutto(with tax) prices in magento2 inside the custom block?

I try to show the 2 prices.


texts: Magento2 Add custom tracking script when product is added to cart

texts:
Magento2 I need to add custom tracking script when product is added to cart. This script is to be added only once with product data of that particular product that is added to cart.

I have 2 scenarios as my site is multi website, in 1 product after being added to cart user is redirected to Cart page & in 2nd Ajax add to cart.

How can I achieve this?


texts:
In a page template (.phtml) file, we can generate a link to another CMS page using the following snippet:

<a href="<?php echo $this->getUrl('my_page_url_key');?>">Link to my page

But is it possible to have a link generated if we know the ID of the page? Example:

<a href="<?php echo $this->getUrl(3);?>">Link to my page with ID 3

This way the admin can change url key without breaking the theme links.


texts:
I want to upgrade from 2.2.2 to 2.2.3 and I ran the following commands

composer require magento/product-community-edition 2.2.3 --no-update
composer update

Then when I try to do

php bin/magento setup:upgrade

I get "Could not open input file: bin/magento"

When I look it seems as though both files (.htaccess and magento) have been deleted.

Could anyone advise?


texts: Magento2 obeserver or plugin before show the product

texts:
Maybe I do not see the forest for the trees, but I failed to find the following entry point:
I need an event or function for a plugin, where I can add some data to a product.
This data is relevant only, when I show the product on the frontend page, so I do not want to run my snippet, when something is happening at admin side.
I've tried the catalog_block_product_list_collection event, without success.
When I load the main page, there are several sales items, some products from widgets, some product from third party module for slider, etc...
I want to add my data to ALL the product, does not care where does it comes from.
On the product page I've solved it with an observer with catalog_controller_product_view but it could be good if it could be general.
Can anybody suggest me an entry point like this?


texts: Magento 2: Purpose of "Public Cookie Meta Data"

texts:
In the shipping version of Magento 2, there's an afterDispatch plugin on the front controller

#File: vendor/magento/module-page-cache/Model/App/FrontController/MessageBox.php
public function afterDispatch(FrontController $subject, $result)
{
    if ($this->request->isPost() && $this->messageManager->hasMessages()) {
        $publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
            ->setDuration(self::COOKIE_PERIOD)
            ->setPath('/')
            ->setHttpOnly(false);
        $this->cookieManager->setPublicCookie(self::COOKIE_NAME, 1, $publicCookieMetadata);
    }
    return $result;
}

The method appears to set an empty cookie named message_box_display. This cookie is only set if the request is a post and if there are any messages in the global-via-dependency-injection message manager.

What's the purpose of this "meta data" cookie?  My guess would be it triggers a message box on cached pages (given the presence of the same cookie name in vendor/magento/module-page-cache/view/frontend/web/js/page-cache.js).  However, this theory falls apart given the code calls createPublicCookieMetadata with no arguments (meaning no data for the "meta data cookie").

Are my assumptions incorrect? Does anyone know the purpose of this cookie in the larger framework?


texts: I want to add required validation for radio button on product view page. How can I do this in Magento 2?

texts:
I want to 2 radio button on product view page when customer click on ‘Add To Cart’ button need to check does any radio button checked or not? If not then dont allow add to cart. How can I do this?
Thanks in advance


texts: Authorize payment on Magento and capture in our ERP system

texts:
We recently moved to a Magento platform and perform the payment authorization for authorize.net and paypal.  When the order is shipped, that info is sent from our ERP system back to Magento and then the capture is done.

We would like to do the capture on the ERP system (we do send down a token which we can use).  This way the settlement is done in 1 system.

Can Magento just be updated with the shipment information and not have to actually capture the payment?


texts: Disable tier pricing when applying coupon code

texts:
I want to have a web shop where products have tier pricing, such as:

order 3 save 10%
order 10 save 20%

This is easy by setting tier pricing in products.

However, I don't want tier pricing to apply when coupon codes are applied (discount would get too high). So I want a coupon code discount to be based on the base price (1 pcs price). Is there a way to do this?

Example: coupon code ABC123 gives 30% off. So price of items should then be 30% off max at any quantity.

Thanks!


texts: How to display product using jquery carousel template in magento 2.1.2 homepage?

texts: I need to display product in magento 2.1.2 homepage using  jquery carousel template in magento 2. How to create a custom template?


texts: List all products in category, even disabled

texts:
How can I show all products in a category, regardless of its status? I have a category that I want to show all products in the category, even it is disabled, invisible, out of stock, or whatever. I've made a new product/list.phtml template for this specific category and am overriding the Mage_Catalog_Block_Product_List to add a new method to accomplish this. In that method is this code

$catId = 432;  //for simplicity
$category = Mage::getModel('catalog/category')->load($catId);

return $category->getProductCollection()
    ->addAttributeToSelect('sku');

It is only retrieving enabled products. However, if I run the same code in a testing script (outside of catalog module) that loads Magento, I get all products that I'm looking for, enabled and disabled. How can I accomplish this?


texts:
I am using Magento2.2.2 with memcache.

Facing some issue with memcache with-out memcache adding cart is working fine and cart page showing added items.

If enable memcache and configured env.php after click addtocart showing success message item added to cart but cart page is empty.

My env.php configurations

array (
'save' => 'memcached',
'save_path' => 'localhost:11211',
),

Any Answer will appreciate.


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

texts:
I am trying below code for login to site after entering email & password in pop up. Login is working. but pop up is not hiding after successfull login.

protected function _createProduct()
 {

   try {
         if(isset($login) && (is_array($login) && !empty($login)) || ($login!="")){
         $session->login($login['username'], $login['password']);
         $result['redirect'] = $this->_getRefererUrl() ? $this->_getRefererUrl() : Mage::getUrl('customer/account', array(
         '_secure' => true
          ));
                $result['success']  = true;
                Mage::app()->getLayout()->getBlock('head')->addJs('js/hide/here.js');
                $customerId         = Mage::getSingleton('customer/session')->getCustomerId();
         }
         else{
          $customerId = "";
         }

         if ($doSave)
           $product->save();

        return $product;

         }
       catch () {  }
}

  here.js

jQuery(".ajaxlogin-window").hide();

  error

Fatal error :  Call to a member function addJs() on a non-object in line

Mage::app()->getLayout()->getBlock('head')->addJs('js/hide/here.js');

if anyone want to look full controller code : http://pasted.co/9887d0db


texts: Limit Options Based On Previous Choices in a Bundled Item

texts:
Here’s a simple example of what I want to do with a bundled product.

Say I’m building a computer and I have to pick my components from drop down menus.

I pick an AMD Motherboard, that means only AMD CPUs will work for that motherboard. So when I pick the AMD Motherboard I need the intel CPUs to disappear from the next drop down menu to prevent a customer from building an incompatible computer.

Is this something Magento can already do? If not is there a extension that can possibly do what i’m asking?

Thanks for any replies!


texts: How to retrieve the JSON string inside a controller and convert it in an array?

texts:
I have a controller that returns a JSON on the page.
This is the code

//Above in the code
injection of \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory

$result=[
    "orderId"      => $orderId,
    "status"       => $order->getStatus(),
    "grandTotal"   => number_format($order->getGrandTotal(),2),
    "totalFacture" => ...,
    "items"        => $arrItems,
];

return $this->resultJsonFactory->create()->setData($result);

Then I . have a Plugin that intercepts the URL and I should retrieve this JSON and process it.

For now this is what I have:

public function afterExecute(\MyComp\MyMod\Controller\Test\GetOrderInfo $GetOrderInfo, $result)
   {

       //return $result; //Displays the JSON in the browser properly

       //Pass trough the JSON obj OR Retrieve the real JSON string
       //Not working !!
       foreach ($result as $obj){
           echo $obj->orderId;
       }

       //Another attempt shows that $result is not a JSON object it self
       $class_methods = get_class_methods($result);
       foreach ($class_methods as $method_name)
       {
          echo "$method_name<br/>";
       }
       //__construct
       //setData
       //setJsonData
       //setHttpResponseCode
       //setHeader
       //setStatusHeader
       //renderResult
       //___init
       //___callParent
       //__sleep
       //__wakeup

   }

I can't use json_decode because $result is not a string, enev if I see in the browser the expected JSON.

So, how could I retrieve that JSON string and convert it into array?


texts: Magento2 - Wysiwyg images show broken thumbnail

texts:
When I insert a image in the wysiwyg editor (TinyMCE) the image shows properly in the frontend but gets a broken thumbnail image in the editor.

The url it generates in the editor is similar to this:

  http://domain.extension/admin_url/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvcGRmL3BkZi5wbmcifX0,/key/8590a46185af57614af635e08360284c95f20261aa5adaf006acc019ed2e87ca/

Is there a way to show the image properly in the editor?

I'm using magento version 2.1.7


texts: M1.9 - Handing a large amount of simple products?

texts:
I plan to undertake a large project within the next 30 days. I will be dealing with around 8 Million simple products. I think my best plan is to work out the infastructure I'm using, and address any bottlenecks within the stack. Once I recieve the products, I plan to spin up a small Mage instance to see what kinds of issues I run into, then create the final Mage install on a larger server.

I plan to base this on Magento 1.9 - having used Magento 2 I feel it's not ready for such a project as I don't want to have to deal with issues relating to an upcoming platform.

The products won't have images for the time being, but in the near future this will be a needed expansion. My reasoning for this is I will be listing products on large marketplaces (Amazon, Ebay...etc) and will not be running a storefront for the time being.

My main areas for concern is DB load due to the amount of products, PHP being single threaded, and CPU IOPS. I know I can offset some of this using Redis as a database store, caching, SSDs...etc. I am able to utilise an hourly stock feed, which will only include products which require an update, however with that many products I'd imagine there is a lot of change in stock - which means the stock feed will still be large.

I'm leaning towards using AWS, due to it's scalability and ability to split up different sections of my setup, depending on what needs more resources. I haven't had a chance to use AWS infastructure before, but from reading documentation from RDS and S3 buckets, it looks like something that would tick most of the boxes.

If you were in my position, would your go-to be AWS or another provider? If you would use AWS, would you use S3/RDS and why?


texts: Adminhtml form date input type default format wrong

texts:
I've managed to create an Adminhtml form extending \Magento\Backend\Block\Widget\Form\Generic.
I've added each field inside _prepareForm() method using $fieldset->addField() method.
One of the fields is

  $fieldset->addField(
             'birthdate',
             'date',
             [
                 'name' => 'birthdate',
                 'label' => __('Birthdate'),
                 'title' => __('Birthdate'),
                 'required' => true,
                 'class' => '',
                 'singleClick'=> true,
                 'format'=>'dd-MM-yyyy',
                 'time'=>false
                //'format' =>$this->_localeDate->getDateFormat(\IntlDateFormatter::LONG)
             ]
         );

Now... neither formats is taken into account when the form is populated (editing a record). The default value that is read from DB is 1995-12-12.
but the form displays Tuesday, December 12, 1995 at 12:00:00 AM Eastern European Standard Time. When I'm setting the date from the calendar, the format is the desired one.

How can I specify the form to load the data with proper format?


texts: How to inject a block after toolbar block?

texts:
i want to inject a block via a custom layout.xml, here is the layout from base theme

<reference name="content">
    <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
        <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
            <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                <block type="catalog/product_list_toolbar_pager" name="product_list_toolbar_pager"/>
                <!-- The following code shows how to set your own pager increments -->
                <!--
                    <action method="setDefaultListPerPage"><limit>4</limit></action>
                    <action method="setDefaultGridPerPage"><limit>9</limit></action>
                    <action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
                    <action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
                    <action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
                    <action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
                    <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
                -->
                <action method="addPagerLimit"><mode>list</mode><limit>5</limit></action>
            </block>
            <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
        </block>
    </block>
</reference>

i want to inject a block right after toolbar.pthml, here is my current layout.xml

<layout version="0.1.0">
    <default>
        <reference name="content">

                <block type="core/template" name="datefilter" template="datefilter/datefilter.phtml" after="product_list_toolbar" />

        </reference>
    </default>
</layout>

how can i do that?


texts: Magento 2: How to Change Default Attribute Set & Set Our Own

texts:
I have created my Attribute Set. Now all current & future  products belongs to that Attribute Set Only.

So i want to set my "Attribute Set" as Default. Instead of Magento Default Attribute Set.

So when i'm going to Add New Product it will be Automatically Selected with my Attributes loaded.


texts: Magento 2 does not load local language settings

texts:
I am having issues with the local settings for magento 2.2.4. Suddenly my locale settings are not applied anymore. For example I have a store with the dutch language, the langague files are installed, the locale settings are set to dutch and I have done the composer update, setup upgrade, static files, varnish cache clean, normal cache etc etc. But nothing helps. It always stays in english. Very annoying. Anybody?

and when I deploy my static files he only deploys en_US. Don't think that's correct


texts: Magento Advanced Search Page in Search Result Page

texts: How to show the Magento Advanced search page in "Search Result Page" if there is no search result for Magento simple search ?


texts: How do I stop Billing Address being set as shipping by default?

texts:
I just want the My billing and shipping address are the same checkbox to be unchecked by default and let the customer see the form to enter a new billing address.

I think the answer lies within this file:
Magento_Checkout/web/js/view/billing-address.js

But I've tried an awful lot of things with no success.

I need to set isAddressSameAsShipping to false?

I mean I can just uncheck it using JavaScript, but that just seems like cheating..

Thanks


texts: Create Order Totals - Remove currency symbol in Admin Panel

texts: I've added custom totals "Total Weight". It works perfectly on the storefront but in admin panel it displays currency symbol $ and it is formatted with .00. How can I change it? It should be not formatted and prefix $ should be replaced with postfix "lbs".


texts: Autoload error: Vendor autoload is not found. Please run 'composer install' under application root directory in Magento 2

texts:
I cloned one gitlab project into the local system in windows. When I am running the project it shows the error like this.
Vendor autoload is not found. Please run 'composer install' under the application root directory.
Please tell what are the things to be done.
And also why the files like env.php are missing in app/etc folders when cloning it from gitlab?


texts: Error 500 internal server error validate key magento

texts:
I'm new to Magento which makes me a big newbie. I have recently set up a localhost store using XAMPP. Now I want to import 500 products with my CSV file. I've looked up the CSV file structure and I think I did good, so I don't there are any errors there (I may be wrong too).

Anyway, after I try to upload my .csv, nothing happens and it keeps displaying "please wait for" message. After a while, I decided to stop and ran firebug and re-ran import.

I got this error message

  "NetworkError: 500 Internal Server Error -
  https://localhost/myownstore/admin2/admin/import/validate/key/
  <---there was a random key.

I've tried setting file permission to index.php, also changed PHP memory limit value and nothing helps.

Please help me I'm desperate :(


texts:
I am looking for Nameplate extension similar to the one found here:  https://www.soufeel.com/necklaces/design-your-name-necklace

Where can I get the extension or how would I add this functionality myself?


texts:
Currently my template is using Mega Menu. /RWD/ If  'casting supplies' is clicked on an iPad it will go to the category page and not just drop down the menu.

How do I change it so that when 'Casting Supplies' is clicked, it does nothing.

I tried:

// COMMENT OUT THIS LINE
//$html .= 'getUrl() .'" class="'. $outermostClassCode .' '. $_hasChildren .'">'. $this->escapeHtml($this->__($child->getName())) .'';

// ADD THESE LINES
if (!empty($_hasChildren)) {
    $html .= ''.
    $this->escapeHtml($this->__($child->getName())) .'';
} else {
    $html .= 'getUrl() .'" class="'. $outermostClassCode .' '. $_hasChildren .'">'.
    $this->escapeHtml($this->__($child->getName())) .'';
}

Not sure what else to change. Does anyone have a solution?


texts: Customise message.phtml pop up message magento 2

texts:
I want to change the message.phtml template file which renders a pop up message below on product page.

Im not sure where in the KO.js binding message html to change
"My new message"
Here is the message.phtml
<?php

snippet of chrome browsers knockoutjs context extension

UPDATE AFTER CHANGES
Thanks for the help...I added this to my di.xml
<?php

namespace  {{Vendor}}\{{Module}}\Plugin;

use Magento\ConfigurableProduct\Model\Product\Type\Configurable; {

    class MagentoCaptchaValidation
    {
        public function afterGetSpecifyOptionMessage(Configurable $subject)
        {
            return __('Please select a size in order to place your order');
        }
    }
}

Error message received during the compile, why do i need this class MagentoCaptchaValidation
In PhpScanner.php line 183:

  Class {{Vendor}}\{{Module}}\Plugin\MagentoCaptchaValidation does not exist```


texts: Facing issue with elastic search in magento 2.3 cloud

texts:
I am facing an issue with elastic search. I can not able to reindex catalosearch_fulltext.

[2019-05-06 11:54:08] report.CRITICAL: Notice: Undefined index: magento2_stg_product_1_v32 in /app/Staging/vendor/magento/module-elasticsearch/Elasticsearch5/Model/Client/Elasticsearch.php on line 173 {"exception":"[object] (Exception(code: 0): Notice: Undefined index: magento2_stg_product_1_v32 in /app/Staging/vendor/magento/module-elasticsearch/Elasticsearch5/Model/Client/Elasticsearch.php on line 173 at /app/Staging/vendor/magento/framework/App/ErrorHandler.php:61)"} []

Is there anyone knows how can I fix this issue. The issue is getting in only stating site. integration and production site are working fine.

I have already removed all custom attributes from Use in search **, **Use in Layered Navigation and  Use in Search Results Layered Navigation.

Still not working. can anyone help me to fix this issue?

I have already checked with the production database on the staging site.

NOTE: Firstly, we have added attributes manually and then after sometimes we have updated that attributes from upgrade script.


texts: How to add shopping cart rule based on amount of calculated shipping?

texts:
what I would like to be able to do is apply a shopping cart discount based on the calculated shipping from UPS or Fedex.  The idea is, I build $20 into the price of our products.  Any order that has shipping $20 or under gets Free Shipping.  Any order that has shipping over $20 pays the full shipping amount, however gets a $20 discount so they aren't overpaying for shipping.  Is this at all possible with current cart rules or will it require some new programming?

Thanks,


texts: Fatal Error: function getIsInStock() on a non-object in Mediafallback.php on line 112

texts:
I got fatal error in configurable product after update Magento ver. 1.9.2.4 to 1.9.3.1 or 1.9.3.2.

Fatal error: Call to a member function getIsInStock() on a non-object in
magento1/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php on line 112

All my configurable Swatches is using by color. It is ok in Magento ver. 1.9.2.4 after click product (configurable) detail in front-end but I got problem after update Magento version. I try to check error log folder, but nothing output.

** I also try to use default theme in magento and try to Cache Storage Management but both are the same. error is still there.

please advice me how to solve it. Thanks


texts: Create a new grid section in Company Users grid

texts:
I'm trying to add a new section in the Company User grid, accessible through an new filter (next to the existing ones : Show Active Users | Show Inactive Users)

The new filter is based upon a custom field that I added company_advanced_customer_entity

I see that in company_users_listing.xml filters are defined like so :

<filters name="listing_filters" class="Magento\Company\Ui\Component\Filters\Status" ...

Code:

class Status extends \Magento\Ui\Component\Filters {
public function prepare()
{
    parent::prepare();
    $config = $this->getData('config');
    if (isset($config['params']) && is_array($config['params'])) {
        $config['params']['statusActive'] = \Magento\Company\Api\Data\CompanyCustomerInterface::STATUS_ACTIVE;
        $config['params']['statusInactive'] = \Magento\Company\Api\Data\CompanyCustomerInterface::STATUS_INACTIVE;
        $this->setData('config', $config);
    }
}

but I don't understand how it works, will I have to rewrite \Status or should I create my another Filter and put it somewhere in the listing ?

UPDATE

In the mean time I added a new statusPending state to the native Status:

$config['params']['statusPending'] = \Vendor\Module\Helper\Account\Process::CUSTOMER_COMPANY_PENDING_STATUS_PENDING;

and had to add it in several places :

Magento\Company\Ui\Component\Listing\Column\CustomerStatus
Magento\Company\Model\Customer\Source\Status


texts:
I am having an issue with breadcrumbs on Magento EE 1.11.2.0

The problem is: when multiple pages are being processed by FPC the CMS page picks up breadcrumb title from another page.

e.g. if http://www.domain.com/cms-page and http://www.domain.com/category.html were loading together in different tabs

the CMS page will show Home / Category Name instead of Home / CMS Page breadcrumb.

If FPC is disabled everything works correctly. I debugged the code and the variables are picking up correct breadcrumb however when the page is rendered from cache it picks up incorrect breadcrumb.

The problem seems to lie in FPC but I am unable to identify the exact problem or its solution.

Any help would be highly appreciated.


texts: Magento 2.3.1 styles.css not loaded on frontend

texts:
I just installed a fresh Magento 2.3.1, and I ran the following code to deploy sampledata. bin/magento sampledata:deploy

The sample data are successfully installed but styles.css is not loading. I have checked pub/media folder, and I can see the styles.css does exist.

I tried the following step to fix the problem

bin/magento setup:upgrade , bin/magento setup:di:compile and bin/magento cache:flush
I cleared all content from folder generated, var/cache, var/page_cache, var/view_preprocessed, pub/static/ and flushed cache again.
I give pub folder 777 permission.

but the styles.css is still not loaded on the frontpage.

This is the first time I experienced this weird issue. any suggestions?

I'm using luma theme and Magento 2.3.1

PS:

  styles-m.css and styles-l.css are loaded successfully. it's only the
  pub/media/styles.css not loaded.


texts:
I've got 2 shops:

shop.example.com
dev.shop.example.com (dev version)

If I login on first shop I can't logon on the 2nd anymore...
It's a cookie problem.

mysql> select * from core_config_data where path like '%cookie%';
+-----------+---------+----------+----------------------------------------+----------------+
| config_id | scope   | scope_id | path                                   | value          |
+-----------+---------+----------+----------------------------------------+----------------+
|       370 | default |        0 | web/default/cms_no_cookies             | enable-cookies |
|       373 | default |        0 | web/cookie/cookie_lifetime             | 3600           |
|       374 | default |        0 | web/cookie/cookie_path                 | NULL           |
|       375 | default |        0 | web/cookie/cookie_domain               | NULL           |
|       376 | default |        0 | web/cookie/cookie_httponly             | 1              |
|       377 | default |        0 | web/cookie/cookie_restriction          | 0              |
|       383 | default |        0 | web/browser_capabilities/cookies       | 1              |
|      1977 | default |        0 | admin/security/session_cookie_lifetime | 10000          |
+-----------+---------+----------+----------------------------------------+----------------+
8 rows in set (0.00 sec)

What are the correct settings for the cookie_path and cookie_domain?


texts: How to translate extra custom strings in template/catalog/product/view/addto.phtml?

texts:
Magento Core: 1.9.2.4
Theme: Milano - Fashion Responsive Magento Theme

I have added a few extra custom strings in /app/design/frontend/alomilano/home02_fashion/template/catalog/product/view/addto.phtml
like this:

<?php echo Mage::helper('catalog')->__('need help?') ?>

also tried like this:

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

and added the strings in /app/locale/en_US/Mage_Catalog.csv & /app/locale/el_GR/Mage_Catalog.csv like this:

"need help?","need help?" (en_US)
"need help?","χρειάζεσαι βοήθεια;" (el_GR)

The translation in Greek (el_GR) works perfect, but when I switch to the English website (en_US) it still shows me the Greek translation!

I have clear ALL caches (many times).

What am I doing wrong?


texts: How can I override module-sales\view\adminhtml\templates\order\comments\view.phtml?

texts: I did similar at Magento 2.1.6 : How to override Adminhtml Module Sales view totals.phtml but nothing change? There are 2 xml use the same template sales_order_invoice_addcomment & sales_order_creditmemo_addcomment (Magento 2.3)


texts:
Magento invaild user name and password not showing.

  I open in Login page
  Enter Invalid username and password it redirect
  to previous page but not logged in  if i click login again it redirect
  to login page it shows error

what is the problem on it


texts: Why does PATCH_SUPEE-6788 appear to have no effect on a 1.7.0.2 installation?

texts:
Note:  This issue appears to apply to all versions of Magento which received the SUPEE-6788 patch.  You'll see in my answer that both .htaccess and .htaccess.sample need to be restored for the patch to succeed.

I'm working on applying the SUPEE-6788 patch to a CE 1.7.0.2 site using the shell script provided by magentocommerce.com/downloads.  The site has had all previous security patches applied.

The script's name is PATCH_SUPEE-6788_CE_1.7.0.2_v1-2015-10-27-12-00-16.sh and has an md5sum of cfc0cf533fe36a5f573414f0feeb1590 (this patch was unusual in that it was released uncompressed–although the file doesn't appear corrupt or truncated).

When running this script the console output appears to indicate that at least one of the included patches failed or was skipped, but that many parts of the patch were successful, however git is showing no changes.  The script has been tested on two different environments with the same codebase--one an Ubuntu GNOME 14.04 LTS workstation, the other a nexcess.com shared server (running CentOS).

Of interest is that the output on the two environments is slightly different.  Note the lines starting with "checking" vs "patching".

A sample of output from the Ubuntu environment:

bash PATCH_SUPEE-6788_CE_1.7.0.2_v1-2015-10-27-12-00-16.sh                                              [19:27:10]
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

checking file .htaccess
Hunk #1 FAILED at 207.
1 out of 1 hunk FAILED
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git .htaccess.sample .htaccess.sample
|index 546f18e..3e79c77 100644
|--- .htaccess.sample
|+++ .htaccess.sample
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
checking file app/code/core/Mage/Admin/Model/Block.php
checking file app/code/core/Mage/Admin/Model/Resource/Block.php
checking file app/code/core/Mage/Admin/Model/Resource/Block/Collection.php
checking file app/code/core/Mage/Admin/Model/Resource/Variable.php
checking file app/code/core/Mage/Admin/Model/Resource/Variable/Collection.php
checking file app/code/core/Mage/Admin/Model/Variable.php
...

A sample from the CentOS environment:

bash PATCH_SUPEE-6788_CE_1.7.0.2_v1-2015-10-27-12-00-16.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file .htaccess
Hunk #1 FAILED at 207.
1 out of 1 hunk FAILED -- saving rejects to file .htaccess.rej
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git .htaccess.sample .htaccess.sample
|index 546f18e..3e79c77 100644
|--- .htaccess.sample
|+++ .htaccess.sample
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
patching file app/code/core/Mage/Admin/Model/Block.php
patching file app/code/core/Mage/Admin/Model/Resource/Block.php
patching file app/code/core/Mage/Admin/Model/Resource/Block/Collection.php
patching file app/code/core/Mage/Admin/Model/Resource/Variable.php
...

I'll be digging into the error at the top of the output and possible manually applying the patches--but was hoping that someone might have insight into the cause or a relatively simple fix.


texts: Magento2 No Payment methods showing in Frontend

texts:
I am developing a site on a local server using developer mode (in env.php) I enable the checkout to the payment page, however, despite setting up all payment methods (individually as well to test for any conflicts) it is showing as No Payment Methods

I have Enabled all Methods.

Can anyone shed any light?


texts:
I followed the below link for data migration.

https://www.cloudways.com/blog/migrate-from-magento-1-to-magento-2/

Once i run below command i am getting

php bin/magento migrate:data --reset < path to your config.xml > --- replaced the path for my m1 version that is 1.9.0.1.

[Migration\Exception]

Integrity Check failed

error. Can anyone suggest please? What is the cause for this?

in config.xml i added the below code.

 <source>
    <database host="host-name" name="db-name" user="user-name" password="password" />
</source>
<destination>
    <database host="host-name" name="db-name" user="user-name" password="password" />
</destination>
<options>
<crypt_key>crypt-key</crypt_key>
</options>

Here is the screenshot.


texts: Getting errors in Magento 1.9.3 SECURITY SCAN - Total four error critical error

texts:
I checked my site in Magento SECURITY SCAN and found these result.

Magento Brute Force
Magento SUPEE 5994
Magento SUPEE 6285
SSL TLS

I tried to solve these but not getting success.
What I can do on these issues.

I am doing these check because I am getting lot of spam with account creation in-spite of I have configured captcha in registration page.


texts: Configurable Product Turning into Simple Products Mass Import CSV Magento2

texts:
Hello StackExchange community!

I am having a serious issue with my Magento CSV mass product import to Magento2.

I have about 1800 SKUs to upload and am testing a configurable product and their corresponding simple products to start.

My issue is, is that my configurable product, says configurable within the CSV column, but is being transposed as a simple product upon upload completion.

This obviously, is not allowing me to view the product in different sizes, as it would be if the configurable product loaded.

Magento 2 will also not allow me to upload this "configurable" product without a price, which I find strange.

Can someone please help with this situation? I can elaborate further if required.


texts: Customer VS persistent/customer templates

texts:
I want to know exactly what is the difference between templates located in customer and persistent/customer and why Magento created the two ?

Exemple :

app/design/frontend/{package}/{theme}/template/customer/form/register.phtml

app/design/frontend/{package}/{theme}/template/persistent/customer/form/register.phtml

If I have to modify the register.phtml for exemple or login.phtml, I have to take the first one or the second ? In my case it was the second since always but I want to have an explanation.


texts: Serious perfomance problems after hosting company installed Nginx! Can I unistall it?

texts:
Magento 1.9.1
Porto theme

We have had perfomance problems for the last few days. Today, when I tried to re-index - I got the following Error:

  504 Gateway Time-out nginx

I remember we had problems last time the hosting installed Nginx and things improved once they removed it. They don't want to unistall it this time though (instead they want access to the Magento Admin panel so that they can reprodruce the problem which will be difficult because it happens intermittenly). Is it safe for me to remove Nginx myself? Why is it that it is causing problems for us? Anything we can try to fix this would be helpful.

Additional info:

I didn't explain things correctly...the re-indexing while inconvenient is not the problem! What I'm looking at more is the increased load we are experiencing which may or may not be related to Nginx. I am almost 100% certain that the last time we had Nginx running - we had all kinds of serious problems (high load = slow Magento websites as a result) and no apparent benefits. I don't think we need Nginx, do we? I would much rather get rid of it...


texts: Email problems / 100% Failure Notices errorcode 550

texts:
I hope someone can help us or can give us a tip or direction how to solve the next problem?
We started using the standard build in email from magento 2. Only we found out a lot/most emails that customers would receive goes directly in their spam folder because fe. Google mention "Gmail cannot verify that this message was sent by copyshopdehaan.nl (and not by a spammer)"
After a heavy discussion for 4 weeks with our supplier they recommended a SMTP extension so we went for Aitoc's SMTP which being installed. After installing and we did setup all credentials/ports etc we got only failure notices after magento 2 sends automatic order, invoice, contactform emails, all came back with error code 550;
91.184.19.251 failed after I sent the message.
Remote host said: 550 Messages should have one or no Content-Type headers, not 2.
--- Below this line is a copy of the message.
Return-Path:
Received: (qmail 2976 invoked from network); 27 Aug 2020 16:49:59 -0000
Received: from unknown (HELO 93.90.187.184) (webstore@copyshopdehaan.nl@[93.90.187.184])
by 172.17.0.4 with ESMTPSA (DHE-RSA-AES128-GCM-SHA256 encrypted, authenticated); 27 Aug 2020 16:49:59 -0000
Date: Thu, 27 Aug 2020 16:49:55 +0000
From: CustomerSupport Copyshop De Haan
Please if you have some tips, thoughts etc we would appreciate these!
Thanks in advance


texts: Show related products with list style on product page in Magento 2?

texts:
I was able to show the related products on the product page inside the 'related product' tab. However, it is in grid style. I'm wondering if there is a way to show them with "list style" ( like the category list page)?

this is the related product section of the catalog_product_view.xml

    <!--related product tab-->
    <block class="Magento\Catalog\Block\Product\ProductList\Related" name="product.info.related" template="Magento_Catalog::product/view/info.phtml" group="detailed_info">
        <arguments>
            <argument name="type" xsi:type="string">related</argument>
            <argument translate="true" name="title" xsi:type="string">Related Products</argument>
            <argument name="sort_order" xsi:type="string">40</argument>
            <argument name="priority" xsi:type="string">6</argument>
        </arguments>
    </block>

this is my current phtml template for related product

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

I want it to show like this ( list style)


texts: Magento 2 - Updating custom customer attribute programmatically

texts:
I am trying to update a custom customer attribute, I have the following code

<?php
namespace Vendor\Module\Plugin;

use Magento\Customer\Model\ResourceModel\CustomerRepository;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Api\Data\CustomerInterfaceFactory;
use Magento\Customer\Model\CustomerFactory;

class CustomerAfterSave
{
    protected $_customerDataFactory;
    protected $_customerRepositoryInterface;
    protected $_customerRepository;

    public function __construct(
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface,
        \Magento\Customer\Model\CustomerFactory $customerFactory,
    ) {

        $this->_customerRepositoryInterface = $customerRepositoryInterface;
        $this->_customerFactory = $customerFactory;
    }

    public function afterSave(CustomerRepository $subject,$savedCustomer)
    {
        //Get Customer
        $customerId = $savedCustomer->getId();

        $customer = $this->_customerRepositoryInterface->getById($customerId);
        $customer->setCustomAttribute('my_custom_attribute', 'test');
        $this->_customerRepositoryInterface->save($customer);
        exit;

But then I get the following error

( ! ) Fatal error: Maximum function nesting level of '256' reached, aborting! in /vendor/magento/module-customer/Model/ResourceModel/Address.php on line 58

Could anyone advise and see where I am going wrong

Edit: I don't believe this to be a duplicate question as I have disabled xdebug and the code just times out

Further edit: I think my problem is the same as Magento 2 : How to save data in database


texts:
On our Magento 2.2.2 based website we are setting up, we are getting the below 2 error messages (in google console).
 I have seen only one other post on the site about this issue and based on what I have read made sure the .htaccess file is in the pub/static folder I also changed the file ownership and also. The file permissions to 777 recursively.

However, still getting the same error?
Any suggestions?

Refused to apply style from '/pub/static/frontend/Smartwave/porto_child/en_US/css/styles-l.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Refused to apply style from '/pub/static/frontend/Smartwave/porto_child/en_US/css/styles-m.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.


texts: Change product page layout and design for the bundle product, in Magento 1.9

texts:
What I did

1) Moved bundle folder from rwd to my active custom them template folder.

2) In app/design/frontend/rwd/ysv/layout  addedd below code,

<catalog_product_view> // under this
    <PRODUCT_TYPE_bundle translate="label" module="bundle">
        <reference name="product.info">
            <action method='setTemplate'><template>template/catalog/product/bundle/view.phtml</template></action>
        </reference>
    </PRODUCT_TYPE_bundle>
</catalog_product_view>

3) Copied view.phtml from

app/design/frontend/rwd/ysv/template/catalog/product to app/design/frontend/rwd/ysv/template/catalog/product/bundle

Still same template is shown for bundle and simple product.

Update: 1

If i Move (as suggested below) <PRODUCT_TYPE_bundle> tag out of <catalog_product_view> tag
then view of bundle/view.phtml is loaded (shown when i on Template Path Hints)but except header files and footer files nothing is loaded.

Update 1.1

I tried to replicate a block section in app/design/frontend/rwd/default/template/catalog/catalog.xml

 <PRODUCT_TYPE_bundle translate="label" module="catalog">
        Catalog Product View (Simple)
        <reference name="product.info">
            <block type="catalog/product_view_type_bundle" name="product.info.bundle" as="product_type_data" template="catalog/product/view/type/bundle.phtml">
                <block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">
                    Product Extra Info
                </block>
            </block>
            <block type="catalog/product_view_type_bundle" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/bundle.phtml" />
        </reference>
    </PRODUCT_TYPE_bundle>

still no chagnes.


texts: Move search form right after top menu in Magento 2.2

texts:
How to move mini search form after header menu? I am using

<move element="top.search" destination="catalog.topnav" after="-"/>

to achieve this but no success.


texts: Session not working after memcached activation

texts:
I am setting up a Magento store.
The server is running Ubuntu 18.04.5 and Magento 2.4.
After the memcached (service and php extension) installation I updated Magento's session configuration.
Now when i try to access my website i am getting an error.
I need help :/
Error

Magento session configuration (app/etc/env.php)

PHP session configuration

Linux Memcached information


texts:
I am new to Magento, still learning how things work here.

I am planning to create a custom module, which would submit a form on a product page through AJAX. It would let the client ask about product details etc. And here is my question: what is the best approach for developing such module, what steps should I take to create this functionality? Any tips would be greatly appreciated.

Thanks in advance.

Magento version: 1.9.3.1

//EDIT:

Requirements:

Create custom module for possible further development and reusing in other projects;
Create custom form ("Ask a question") for each product;
Submitting a form will send an email with specific information (product id, link to product's view, information given by client etc.)
Form should be submitted with AJAX;


texts:
I was checking through URLs and found that mydomain.com/media is giving public access to upload and download files from the server without restriction.
I tried adding the code in htaccess file to restrict access but it is restricting my theme to access the images and media too from the folder.
the code that i used:

Order deny,allow
Deny from all

My current htaccess is as below kindly suggest some edit that would restrict direct access but allow theme to access the media folder.

Options All -Indexes
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>

# AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## never rewrite for existing files
    RewriteCond %{REQUEST_FILENAME} !-f

############################################
## rewrite everything else to index.php

    RewriteRule .* ../get.php [L]
</IfModule>


texts: Magento 2 : In which element are image properties configured in etc/view.xml?


texts:
This has started happening very recently with a new build of Chrome.
Checkout still works fine on Firefox, Safari, etc.

When you try to checkout you get an error at payment.

When "set-payment-information" is POSTed the email part of the payload is null.

Error message:
"email" is required. Enter and try again.

What can I do?


texts:
If i run the cron command php bin/magento cron:run im receiving the below error.

  [Magento\Framework\Exception\LocalizedException]
  Invalid Document
  Element 'group', attribute 'name': The attribute 'name' is not allowed.
  Line: 9

So i searched and found out that it is an issue with missing 'title' in some acl.xml file. I tried applying many fixes which i found online but still the issue persist.

Please help me sort this issue. Kind regards.


texts:
We are in the process of deploying our Magento shop to AWS EC2 but are seeing some serious performance degradation. Our development server has the same set of the Magento code as the production server.

Here are the details for the development server:

Ubuntu Server 12.04
4 virtual CPU's (the host is ESXi 5.5) (physical CPU is i7-4790 @ 3.6GHz)
4Gb memory
MySQL 5.5 on the same VM
Redis cache enabled for backend and session (on a different VM)
APC cache enabled
local network

Using the firefox Network monitor, the waiting time to access a product page is approx 500ms.

For the production server(s):

Ubuntu Server 12.04 HVM
frontend and admin are on different hosts, both have instance type m3.medium (1 virtual CPU, 3.75Gb memory, physical cpu is probably Xeon E5-2670 v2 @ 2.5GHz)
code is mounted from admin to frontend using NFSv4, with these options: rw,insecure,no_subtree_check,async
MySQL 5.5 on Amazon RDS in the same region, same subnet but different availability zone (instance type db.m3.medium, 1 virtual CPU, 3.75Gb memory, query_cache_size is set to 16M... for some reason the default was set to 0)
Redis cache enabled for backend and session (on a different EC2 instance)
APC cache enabled
AWS region is US East (latency from our office to AWS US East is about 250ms)

Using the firefox Network monitor, the waiting time to access a product page is approx 2000ms.

We tried using Magento in the local filesystem instead of NFS, but it doesn't seem to reduce the waiting time.

We tried accessing a page that doesn't hit the database (such as a Magento 404 page), and the waiting time in AWS EC2 is approximately 4 times longer than our development server.

We are not sure if moving from m3.medium to say, a c3.xlarge instance type will make any difference.

Can anyone provide any insights?

Update

We just created a new c3.xlarge instance (4 virtual CPU's and 7.5Gb memory) and put Magento there. The waiting time reduces to approximately 1500ms but this is still nowhere near 500ms on our development server.


texts: Products not showing in parent categories

texts:
I want products that are in a sub category to appear in the parent category page on the front end also.

So all parent/child products appear in parent.

All questions relating to this say to make sure anchor is set to on in the category settings.  All my categories have anchor enabled but only products explicitly set for the parent categories appear there, none of the child categories products appear in the parents category page on the front end.

I have re-indexed and cleared cache.  Is there a setting I am missing?

If I add the parent category tag to the product then it appears in parent category but I want to be able to tag the product with child category and then the product also appears in all the parent categories.


texts: How to get customer from observer in Magento 2?

texts:
I need to send data to an external API when a customer (I mean a logged in customer) add a product to wishlist.

I found the event: wishlist_add_product.

$this->_eventManager->dispatch(
    'wishlist_add_product',
    ['wishlist' => $wishlist, 'product' => $product, 'item' => $result]
);

This event is not related to a customer, this is also triggered when a guest user add a product to wishlist.

In my Observer I have to check if the user is logged in, then I have to load some customer details and I can call the API.

The question is:

  How do I get the customer ID if it is authenticated, when the customer object is not present in the dispatch?

app/code/Vendor/Module/etc/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="wishlist_add_product">
        <observer name="my_wishlist_add_product" instance="Vendor\Module\Observer\MyObserver" />
    </event>
</config>

app/code/Vendor/Module/Observer/MyObserver.php

<?php
namespace Vendor\Module\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class MyObserver implements ObserverInterface{
    public function execute(Observer $observer){
        // here I need something for load the logged in customer (if it is logged in)
    }
}