texts: CORS Header set Access-Control-Allow-Origin "*" not working for google fonts

texts:
I have this piece of code in my .htaccess file
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"

Header set X-UA-Compatible "IE=edge"

# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?
g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?
|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
     Header unset X-UA-Compatible
</FilesMatch>

</IfModule>

on the first line i have the Header set Access-Control-Allow-Origin "*" and it does not seem to be working for any browser except for chrome. I tried using this in my root .htaccess file as well as .htaccess file in app folder. Keep in mind I am using @font-face in css for these google fonts.
Is there something i am doing wrong?


texts: Availability-only not shown on inventory level in Magento 1.9

texts:
For my Magento store, the threshold qty is not considered on inventory level, although this is set up in the backend.

This is the view with the output of the QTY message

  app/design/frontend/base/default/template/cataloginventory/stockqty/default.phtml

<?php if($this->isMsgVisible()): ?>

        <span title="<?php echo $this->__('Only %s left', ($this->getStockQty())) ?>"><?php echo $this->__('Only %s left', "{$this->getStockQty()}") ?>

<?php endif ?>

This file gets the input out of

  app\code\core\Mage\CatalogInventory\Block\Stockqty\Abstract.php

public function isMsgVisible()
    {
        return ($this->getStockQty() > 0 && $this->getStockQty() <= $this->getThresholdQty());
    }

but it seems that $this->getStockQty() is not considering the manually edited inventory qty.


texts: Magento 2: How to override Zend library files function only?

texts:
I would like to override below file

magento\vendor\magento\zendframework1\library\Zend\Captcha\Image.php

Can we do with

magento\app\code\zendframework1\library\Zend\Captcha\Image.php ?

What will be the class extends?

Following http://webkul.com/blog/overriding-rewriting-classes-magento2/

It's giving 90% answer.

magento\app\code\Zend\Captcha\Image.php

class Zend_Captcha_Image extends Zend_Captcha_Word
{
    protected function _generateImage($id, $word)
    {
    }
}

I want only this function. It gives abstract class error. If i only put this.

Can we override composer.json for this? Don't want to change in Magento Default

When u click on "Reload Captcha" it gives big DIV blank then it loads. It's not working as default works. Something still missing in override.


texts: dropdownDialog widget cant listen to dialogopen

texts:
I wanted to add some custom animations to my minicart and therefore I have to listen for dialogopen and dialogclose events.

The script is loaded and executed but all my attached listeners are not triggered and I cant get it to work.
I wrote an example trying multiple approaches but none of them seem to work.

JS:

define(["jquery", "jquery/ui"], function($) {

    console.log("test");

    $("[data-block='minicart']").on("dialogopen", function(e) {
        console.log("dialogopen");
    });

    $(".ui-dialog-minicart").on("dialogopen", function(e) {
        console.log("dialogopen 1");
    });

    $("body").on("dialogopen", "*", function(e) {
        console.log("dialogopen 2");
    });

    $("[data-block='minicart']").on("open", function(e) {
        console.log("open");
    });

    $(".ui-dialog-minicart").on("open", function(e) {
        console.log("open 1");
    });

    $("body").on("open", "*", function(e) {
        console.log("open 2");
    });

    return;
});

Does the Magento UI library intercept these events or am I doing something wrong?


texts: I am trying to add a phtml through xml. But I can not add. Code shared below

texts:
trying to add a phtml through xml to account page sidebar. but i am not getting it right.
the xml code is:


texts: Magento 2 - How can I add custom template file into  in backend/admin?

texts:
I know that we can add a custom block in the head as follows :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="head.additional">
        <block class="Magento\Framework\View\Element\Template" name="block_name" template="path_to_file.phtml" />
    </referenceContainer>
</body>

but when i tried the same in admin i am unable to add the block, have tried following reference blocks till now :

<referenceContainer name="head">

<referenceContainer name="head.additional">

When i try adding block using

<referenceContainer name="content">

it works great but as i need to add dynamic name of the Google fonts i need it in <head> tag.

I am trying to add above code in backend's sales_order_view.xml

Any help will be great.


texts: How do I assign associated products to a grouped product programatically in Magento2?

texts:
I have the following abridged code that I believe should assign a product to a grouped product; however when ran it doesn't create the assignment; that is - no entry is saved into the catalog_product_link table.

I've tried a few different ways (using the Data APIs/Interfaces) but have so far come up blank.

$obj = $this->_objectManager->create('\Magento\Catalog\Model\ProductFactory');

$product = $obj->create()->load(904); // productId of my grouped product

$product->setProductLinks([
    [
        "sku" => "group_sku",
        "link_type" => "associated",
        "linked_product_sku" => "simple_sku",
        "linked_product_type" => "simple",
        "position" => 1,
        "extension_attributes" => ["qty" => 1]
    ]
]);

$product->save();

Does anyone have any suggestions as to where I'm going wrong / or has anyone got a working code example?


texts:
I see here many questions how to remove SID. It seems this is not very rare. How that even happen? Even if php ini settings for session.use_trans_sid is true and Magento setting Use SID on Frontend set to Yes, Magento won't pass SID to url.

So in which situation SID will appear in url? How can you pass SID to url, is that something that can be done only if you change core url model or are there any other ways?


texts: How to display custom block in product_list_toolbar?

texts:
I have a problem with displaing my custom block in toolbar toolbar-products between sorter and toolbar-amount.
I tried this code:

<referenceBlock name="product_list_toolbar">
<block class="Vendor\Module\Block\CategoriesSiblings" name="categoriessiblings" template="Vendor_Module::categoriessiblings.phtml"/>
</referenceBlock >

in my catalog_category_view.xml but nothing shows.
I can display this block without problems in:

<referenceContainer name="content">
</referenceContainer>

Thanks in advance for any help


texts: Order Items not shown on transnational email

texts:
For some reason, I've not been successful on showing the Order Items on Oder transnational email. I have used the suggested line of coding below:

{{/if}} {{layout handle="sales_email_order_items" order=$order}} {{depend order.getIsNotVirtual()}} {{/depend}} {{depend order.getIsNotVirtual()}} {{/depend}}

And some variations of it. Rest of the email is working good. Anyone knows what is going on?

Many thanks all!


texts: unexpected changes in my product page layout?

texts:
unexpected changes in my product page layout that attached in the first screenshot happened to my product page bootstrap layout system .... i can't get back to my default magneto layout as it attached in the second screenshot

and there is the different of the html and css code by the inspect elements in the browser


texts: How to hide price and add to cart for products of catalog for specific group magento 2

texts: I have 2 catalog and i have two group customer: how to proceed to hide price and add to cart for each product in catalog 2 when a customer belong to group1 is log in and  same for the customer that belong to group 2 he can't see the price none add to cart of products that belong to catalog 1


texts: Add a custom option through event observer for a specific product type, in Magento-2.1.7

texts:
I have created a custom product type as "mycustomtype", programmatically.
Now, I want to add a text area as custom option for a specific product type, through an event observer.

In detail,

Whenever the admin adds a new product, selecting the product type as "mycustomtype", I want a custom option(Text Area), that appear automatically for those "mycustomtype" products. To achieve this, I have written an observer for the event catalog_product_save_after and in my observer file , my execute function looks like the following,

public function execute(\Magento\Framework\Event\Observer $observer ) {

    if($_product->getTypeId()=='mycustomtype' && $_product->isObjectNew()==1) {

        $_product       = $observer->getEvent()->getProduct();
        $productId = $_product->getId();

        $options = [
            'title' => 'Enter Message',
            'type' => 'field',
            'is_require' => 1,
            'sort_order' => 1,
        ];

        $customOptions = [];
        $this->objectManager  = \Magento\Framework\App\ObjectManager::getInstance();
        $customOptionFactory = $this->objectManager->create('Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory');
        $customOption = $customOptionFactory->create(['data' => $options]);
        $customOption->setProductSku($_product->getSku());
        $customOption->setOptionId(null);
        $customOptions[] = $customOption;
        $product =  $this->objectManager->create('\Magento\Catalog\Model\Product')->load($productId);
        $product->setOptions($customOptions)->save();
        $product->setCanSaveCustomOptions(true);
    }
}

When the observer is fired, the execution takes a long time and gives me an error as follows,

  SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: INSERT INTO url_rewrite (redirect_type,is_autogenerated,metadata,description,entity_type,entity_id,request_path,target_path,store_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?, ?, ?)

Any help would be greatly appreciated.


texts:
This is my Load more Script, first page Ajax Add to cart, working fine, but if I go to second page, ajax add to cart, is not working

I checked the network tab for the add to cart ajax request, and its not getting called. Hence I added the below code

$("form[data-role='tocart-form']").catalogAddToCart(); but No luck

<script src ="https://infiniteajaxscroll.com/vendor/jquery-ias/dist/jquery-ias.min.js"></script>
<link src = "https://raw.githubusercontent.com/ravbetsky/infinite-ajax-scroll/master/dist/css/jquery.ias.css"/>
var ias = jQuery.ias({
    container:  ".test",
    item:       ".products-grid",
    pagination: ".pages-items li",
    next:       ".item a"
});
ias.extension(new IASSpinnerExtension());            // shows a spinner (a.k.a. loader)
ias.extension(new IASTriggerExtension({offset: 3})); // shows a trigger after page 3
ias.extension(new IASNoneLeftExtension({
  text: 'There are no more pages left to load.'      // override text when no pages left
}));
ias.on('rendered', function(items) {
    var $items = jQuery(items);
    $items.each(function() {
      var cartBtn = $("button[class='test']");
      cartBtn.click(function () {
        console.log("Added....");
      var id = this.id;
      alert(id);
      console.log(id);

});

For every scroll first product ajax add to cart working fine


texts:
I am using Magento 1.7. I want to change the placeholder for my search box.

Currently I have

And I want to change this text to "Qué quieres encontrar?".

To do so, I changed the corresponding code in form.mini.phtml under app/design/frontend/default/CUSTOM_THEME/template/catalogsearch, to the following:

<form id="search_mini_form" action="<?php echo $this->helper('catalogsearch')->getResultUrl() ?>" method="get">

        <?php echo $this->__('Search:') ?>
        <input id="search" type="text" name="<?php echo $this->helper('catalogsearch')->getQueryParamName() ?>" placeholder="Qué quieres encontrar?" value="¿Qué quieres encontrar?" class="input-text" />
        <button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><?php echo $this->__('Qué quieres encontrar?') ?></button>
        <?php /*

*/?>

</form>

But didn't get success. Right now I can see the new text only after I click on the search box, but not by default. I already cleared Magento's and browser's cache.

Can anyone please tell me how can I change the text? Any help is much appreciated :-)


texts:
I have default.xml overridden into my custom_theme but is actually an empty file(need not worry about the content).
I want to prevent magento 2 from calling this empty file so as to improve the system performance from the optimization perspective.
Please help.
Thanks in advance!!


texts: what to do when the Special Price not the cheapest?

texts:
I have a Configurable Product and it has 3 Simple Products, one of them has a Special Price that is not the cheapest between them.

For Example :

The red colour cost 15 Euro and the Green colour (who has the Special price) costed now 16 Euro instead of 20 euro.

How to let Magento2 understand that is not always the cheapest Price is the Special Price ?

public function hasSpecialPrice()
{
    $displayRegularPrice = $this->getPriceType(Price\RegularPrice::PRICE_CODE)->getAmount()->getValue();
    $displayFinalPrice = $this->getPriceType(Price\FinalPrice::PRICE_CODE)->getAmount()->getValue();
    return $displayFinalPrice < $displayRegularPrice;
}


texts: Display Popup in magento admin Dashboard

texts:
As you all are aware of, Magento shows a popup on the new version release if the current magento version is below the latest version.

I want to develop a similar type of popup as soon as user logs in into the admin panel.


texts: What does the row weight attribute for a product mean? What is the difference to normal weight?


texts:
I am trying to make this work in Magento, but Magento changes the html and my boss hates it when I want to change anything using cPanel. So I need an option using the dashboard in Magento

           Stock replacement: Bolt in press on bearing

How To Measure

           <embed src="https://dutchmanaxles.com/images/ordering/SR_defined_POB.pdf" type="application/pdf" width="100%" height="600px" />


texts:
i'm trying to override a zend library (Zend_Pdf_Page) and it doesn't seem to be working. i'm putting it in app/code/local/Zend/Zend_Pdf_Page.php, but the parent class is being used instead.

are there any configuration changes i need to make to get it to work?

thanks!

laura


texts:
My online store is Australian based and while setting up recurring profile with paypal I am getting this error.

PayPal gateway has rejected request. Subscription start date should be greater than current date


texts: Bulk Operations Exception: Message queue topic "example.topic" is not configured

texts:
I am trying to implement Bulk Operations in Magento 2.3.1 using the docs here as a reference.

When I call scheduleBulk on the BulkManagementInterface the operation is saved and can be viewed from the Bulk Action log but I get the following exception and my consumer never processes the operation:

Message queue topic "example.topic" is not configured.

I have the following files in app/etc:

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\MessageQueue\MergerFactory">
        <arguments>
            <argument name="mergers" xsi:type="array">
                <item name="ExampleConsumer" xsi:type="string">Vendor\Module\Model\Merger</item>
            </argument>
        </arguments>
    </type>
</config>

communication.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd">
    <topic name="example.topic" request="Magento\AsynchronousOperations\Api\Data\OperationInterface">
        <handler name="processExampleOperation" type="Vendor\Module\Model\Consumer" method="processOperation"/>
    </topic>
</config>

queue_consumer.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd">
    <consumer name="ExampleConsumer" queue="example_queue" connection="db" handler="Vendor\Module\Model\Consumer::processOperation"/>
</config>

queue_publisher.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
    <publisher topic="example.topic">
        <connection name="db" exchange="example.exchange" />
    </publisher>
</config>

queue_topology.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd">
    <exchange name="example.exchange type="topic" connection="db">
        <binding id="ExampleBinding" topic="example.topic" destinationType="queue" destination="example_queue"/>
    </exchange>
</config>

Here is a snippet where I call scheduleBulk:

$bulkUuid = $this->_identityService->generateId();
$bulkDescription = 'Example Bulk Operation';
$operations = [];
$serializedData = [
    'entity_id' => $id,
    'entity_link' => $this->_urlBuilder->getUrl('vendor/controller/' . $id),
    'meta_information' => 'Meta Information',
];
$data = [
    'data' => [
        'bulk_uuid' => $bulkUuid,
        'topic_name' => 'example.topic',
        'serialized_data' => $this->_jsonHelper->jsonEncode($serializedData),
        'status' => OperationInterface::STATUS_TYPE_OPEN,
    ]
];

$operation = $this->_operationFactory->create($data);
$operations[] = $operation;

$userId = $this->_userContext->getUserId();
$result = $this->_bulkManagement->scheduleBulk($bulkUuid, $operations, $bulkDescription, $userId);

if (!$result) {
    throw new \Magento\Framework\Exception\LocalizedException(
        __('Something went wrong while processing the request.')
    );
}

When I run bin/magento queue:consumers:list my consumer is listed, and when I run start it is started.

The exception is thrown from

  Magento\Framework\MessageQueue\Config in the getPublisherConfigByTopic
  function on line 184

. If I log $this->queueConfigData->get() at the top of that function it is an empty array.

Is there an issue with my configuration above that would be preventing it from being loaded?

Note: I have modified the sample code above and replaced with example data.


texts: USPS shipping method does not display for Canada in checkout - magento 1.9.3.7

texts: Can anyone please help me USPS methods is not shown when I select Canada from backend and I have to set allowing shipping to this country please help me.


texts: Transactional emails if conditions discrepancy

texts:
Trying to set different text for registered and guest customers order confirmation email (using single template, not sure why Magento has two different settings for this?) I've come across that {{if order.getCustomerIsGuest()}} always evaluates to true rendering {{else}} useless

I worked it around by using {{if order.getCustomerGroupId()}} but hoping someone can shed some light what can be culprit of this and to avoid other's pitfalls trying to implement this logic the same way as I originally did


texts:
is there any chance how to get ALL third level categories available? I have searched whole internet and found only getting categories based on parent category but it doesnt return whole store 3rd level categories because in this situation I dont have one parent category, since I need all of them. Also I have found a lot of solutions using objectManager but I know you should avoid using it.

P.S. If you have an solution, it would be really nice to do it correctly - using CategoryRepository and definitely not using objectManager.

Thanks a lot!


texts: Out of Stock item in cart causes checkout button to disappear

texts:
We are having an issue that is a big problem but I cannot find a mention of it anywhere else.  If a customer puts an item in their cart that is purchased by someone else before they check out, the checkout button disappears.  There is a small warning under the item on the checkout page that says:

  This item is currently out of stock.

But it doesn't say you must remove it to checkout.  If someone has a lot of stuff in their cart, they probably wouldn't even see that message.

I've never seen a shopping cart that wouldn't let you checkout due to a sold out item if you have other items in the cart. I don't know if this has always been an issue because it's something I never thought to test.

I would like it if there were a warning about the item being unavailable but with the ability to checkout.  Or at the very least I would like it if sold items would automatically be removed from other carts.

We are on Magento Community 1.7.  Running the Ultimento theme.  We do not have backorders enabled.  This happens on the native Magento cart page.

Has anyone else seen this?  If you want to test it on your site, you can just disable an item after you put it in your cart and see what happens.

Thank you!


texts:
2018-11-20T09:31:12+00:00 DEBUG (7): Exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0-hunderefleksvest-str-m' for key 'UNQ_CATALOG_PRODUCT_ENTITY_URL_KEY_STORE_ID_VALUE', query was: INSERT INTO `catalog_product_entity_url_key` (`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`) VALUES (\?, \?, \?, \?, \?)
Trace: #0 /var/www/parkogfritid.dk/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
1 /var/www/parkogfritid.dk/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
2 /var/www/parkogfritid.dk/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
3 /var/www/parkogfritid.dk/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
4 /var/www/parkogfritid.dk/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
5 /var/www/parkogfritid.dk/public_html/lib/Zend/Db/Adapter/Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...', Array)
6 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Catalog/Model/Resource/Url.php(563): Zend_Db_Adapter_Abstract->insert('catalog_product...', Array)
7 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Catalog/Model/Url.php(374): Mage_Catalog_Model_Resource_Url->saveProductAttribute(Object(Varien_Object), 'url_key')
8 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Catalog/Model/Url.php(562): Mage_Catalog_Model_Url->_refreshProductRewrite(Object(Varien_Object), Object(Varien_Object))
9 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Catalog/Model/Url.php(255): Mage_Catalog_Model_Url->refreshProductRewrites('1')
10 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Catalog/Model/Url.php(248): Mage_Catalog_Model_Url->refreshRewrites('1')
11 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Catalog/Model/Indexer/Url.php(257): Mage_Catalog_Model_Url->refreshRewrites()
12 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Index/Model/Process.php(212): Mage_Catalog_Model_Indexer_Url->reindexAll()
13 /var/www/parkogfritid.dk/public_html/app/code/local/Mirasvit/Fpc/Model/Index/Process.php(108): Mage_Index_Model_Process->reindexAll()
14 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Index/Model/Process.php(260): Mirasvit_Fpc_Model_Index_Process->reindexAll()
15 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(182): Mage_Index_Model_Process->reindexEverything()
16 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->massReindexAction()
17 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('massReindex')
18 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
19 /var/www/parkogfritid.dk/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
20 /var/www/parkogfritid.dk/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
21 /var/www/parkogfritid.dk/public_html/index.php(95): Mage::run('', 'store')
22 {main}

Anyone could help me out here to solve this matter?


texts: Automatically signing in a customer through browser who has authenticated with token based authentication

texts:
The usecase here is a mobile app that will create an account for the customer using token based authentication. Using this i can do everything i want from the app. The idea is that the app tells Magento when the phone has reached a certain GPS coordinate, which puts the customer in a Group that is allowed to purchase an otherwise "locked" product.

However when it comes time for the customer to actually purchase something, i want to spawn a browser from the app on the phone and automatically log the user in (either iframe or an actual browser is fine).

I have been considering simply pointing the newly spawned browser at an url that takes in a GET parameter, perhaps the hashed token, or maybe the username and password as long as we do HTTPS. Not entirely sure how I would deal with this in my Magento 2 module.

Are there any other or more straight forward ways of doing this ? Can i get a session somehow and "prime it" ?
What about using something like Facebook auth ?


texts: Transfer Customer Data From Custom System to Magento2, possible?

texts: I know there's a way to transfer data from Magento1 to Magento2 but I'm interested if there's a way to transfer data from custom system to Magento2?


texts: How to convert French accented words into codes for Magento 1.8?

texts:
I have two versions for my store - English and French. And I am doing the translation from English to French in app/locale/fr_FR/Mage_Page.csv

I notice that I have to use some codes for certain French characters, such as En-tÃªte de page for tête de page.

So if I have French words like 100% Magasinage sécurisé, how can use convert it into codes like En-tÃªte de page?


texts: how to pass cron job result to a controller controller

texts:
I need to filter products based on 3 attributes and display those attributes to storefront, I've about 25000 products, so filtering them in each request takes 20 seconds.

I thought about creating a cron job that run daily and returns the result.

the problem is how to pass the value from cron job controller to my module controller.

magento version is 2.1.7


texts: Unit Test for XML code Changes in Magento 2

texts:
We can run Unit test cases for PHP classes in Magento 2 using phpUnit.

I would like to know how to configure and run Unit test cases for XML files like cms_block_form.xml or any other XML files ?

Please guide me on this. Thanks in advance.


texts: How to use ImportExport Import Model in Magento 2.x

texts:
I want to use  ImportExport Import Model. I want to convert the code below to Magento 2.

In Magento 1, it uses:

Mage_ImportExport_Model_Import::getDataSourceModel()->getIterator()->rewind();


texts: API v1 - Invalid API path to documented module/method

texts:
The API documentation describes some product_attribute methods that we can work with

(http://www.magentocommerce.com/api/soap/catalog/catalogProductAttribute/catalogProductAttribute.html ).

These method names contradict what is configured in Mage/Catalog/etc/api.xml.

Documentation shows:

product_attribute.info

While the api.xml shows:

catalog_product_attribute.info

I am making a basic call using:

$proxy = new SoapClient('http://www.example.com/api/?wsdl');
$session = $proxy->login($user, $pass);
$attribute = $proxy->call($session, 'product_attribute.info', $att_name);
// $attribute = $proxy->call($session, 'catalog_product_attribute.info', $att_name);

This results in the error, Invalid API path. If I change the API module/method to the commented line above, I get the same error.

What is the correct API v1 method to use to call product attribute methods?


texts:
I'm currently setting up a webstore and need to create a page which displays all active sub-categories of my brand category. I would prefer this to be done by static-block as you would be able to click on brands in the navigation menu and it would display all brands. I know I can display this in the layered navigation tab but we have over 900 categories.

It would be worthy mentioning that I'm a total Magento noob and this is the first store I'm setting up using Magento. I've wasted countless hours searching the internet for an answer but most are either outdated or are in the form of a ridiculously expensive extension.

If anyone here can help us out it would be excellent, I know its a big ask.

Also we are using Magento Community Edition 1.9.1


texts: Magento Product Search result : How to Filter by a custom Attribute

texts:
We have created a custom attribute for the product. While searching for product we only want to show the products where this attribute is 'True'.

For example assume that the custom attribute is 'master_record', when searching, show only those product for which 'master_record' is true. Which model class do we need to edit/Override to accomplish this.


texts: My Magento 2 is hanging on the Catalog Page - there is an unresponsive script: lib/view/utils/dom-observer.js:201  In Firefox I can skip the script and the page loads - in Safari I cannot.  Any help?


texts: How to add a new field to Custom Options

texts:
How can I extend the "Custom Options" in a configurable product? I need to add a new field named Identifier. Where can I find the necessary templates?

I figured out that the template is in app\design\adminhtml\default\default\template\catalog\product\edit\options\option.phtml, and I added my custom code to it:

But I have no clue to which table I have to add the new attribute "identifier" ?

How can I figure this out?

I thought I have to add it to the table Catalog_Product_Edit_Options_Option because the template is in app\design\adminhtml\default\default\template\catalog\product\edit\options\option.phtml but this threw an error that the table could not be found.

How do I know the right table name where the attribute belongs to?

I tried to install it to the table catalog_product_option_type_value with this install script but it is not the right table, because if I enter something and save something then it is not saved:

<?php

Mage::log("Add attribute 'identifier' to table 'catalog_product_edit_options_option'", 7, "system.log");

$installer = $this;
$connection = $installer->getConnection();

$installer->startSetup();

$installer->getConnection()
    ->addColumn($installer->getTable('catalog_product_option_type_value'),
        'identifier',
        array(
            'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
            'input' => 'text',
            'nullable' => true,
            'default' => null,
            'comment' => 'Identifier of the Option, used to perform specific actions in scripts only on options with certain identifiers.'
        )
    );

$installer->endSetup();

I also added it to the table catalog_product_option but it still does not save.

Update:
I noticed that the value is actually stored into the database, but magento fails to load it in the backend so it looks like it is empty. I used this query

SELECT * FROM `magecatalog_product_option` WHERE `option_id` = 443`

Why does it not show in the backend?


texts: SQLSTATE[HY000] [2006] MySQL server has gone away after "Run import"

texts:
we are using magmi_full_0.7.19a

we tried "Run Import" , we are getting following error.

  SQLSTATE[HY000] [2006] MySQL server has gone away -

is it related to server issue . how to fix this ?


texts: No Logo at PayPal Pro Direct Payment option at checkout

texts:
I just set up PayPal Pro direct payment in my magento. Now the "checkout" has two options:

PayPal and Direct Payment (VISA MC etc) options. For the PayPal option it has a PayPal logo.

For the direct payment it has no logos.

I've tried to change the frontend experience settings, but nothing helps.My goal is to insert VISA Master Card logos right next to the VISA MC option.

Also have tried to customize checkout page at manager.paypal.com but that doesn't hep either.


texts: How to get category id by category path in Magento 2?

texts: I have complete category path like Default Category/Men/Sale. How to get category id using it?


texts: Different holding/maintenance/503 pages for different themes - Magento 2

texts:
I have a multistore site (6 stores) that use 3 different themes, my question is:

How do I set a different maintenance/holding/503 page for different themes?

I can't find anything mentioning this so I'm starting to think you can only have one holding page across all stores/themes. My only idea so far is to try and check the themes inside 503.phtml and alter the markup depending on the theme.


texts: Magento 1.8.1 quick create no longer working JS error

texts:
Hi we installed Magento 1.8.1 and now quick create is no longer for configurable products

I think it is an JS error (See below), but no idea why

Uncaught TypeError: undefined is not a function (index):152
Uncaught ReferenceError: Sortable is not defined 5195b90b81e42880d3e54d723d6ed9e3-1393101403.js:1382
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
Uncaught TypeError: Cannot call method 'quickCreateNewProduct' of undefined (index):2433
onclick

Question: Did anyone encounter this one too? or know how to fix?

Do I need to maybe update my JS scripts manually

This is where it happens

<button  id="id_8f01c149ffc97ffcb5de0bc30f30d712" title="Quick Create" type="button" class="scalable save" onclick="superProduct.quickCreateNewProduct()" style="">Quick Create</button>


texts: Magento 2: How to override file Mail.php

texts:
I want to override this file :vendor\magento\module-contact\Model\Mail.php

  vendor/module/Model/Mail.php

    <?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace vendor\module\Model;

use Magento\Framework\Mail\Template\TransportBuilder;
use Magento\Framework\Translate\Inline\StateInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\Area;

class Mail
{
    /**
     * @var ConfigInterface
     */
    private $contactsConfig;

    /**
     * @var TransportBuilder
     */
    private $transportBuilder;

    /**
     * @var StateInterface
     */
    private $inlineTranslation;

    /**
     * @var StoreManagerInterface
     */
    private $storeManager;

    /**
     * Initialize dependencies.
     *
     * @param ConfigInterface $contactsConfig
     * @param TransportBuilder $transportBuilder
     * @param StateInterface $inlineTranslation
     * @param StoreManagerInterface|null $storeManager
     */
    public function __construct(
        ConfigInterface $contactsConfig,
        TransportBuilder $transportBuilder,
        StateInterface $inlineTranslation,
        StoreManagerInterface $storeManager = null
    ) {
        $this->contactsConfig = $contactsConfig;
        $this->transportBuilder = $transportBuilder;
        $this->inlineTranslation = $inlineTranslation;
        $this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class);
    }

    /**
     * Send email from contact form
     *
     * @param string $replyTo
     * @param array $variables
     * @return void
     */
    public function send($replyTo, array $variables)
    {
        /** @see \Magento\Contact\Controller\Index\Post::validatedParams() */
        $replyToName = !empty($variables['data']['name']) ? $variables['data']['name'] : null;

        $this->inlineTranslation->suspend();
        try {
            $transport = $this->transportBuilder
                ->setTemplateIdentifier($this->contactsConfig->emailTemplate())
                ->setTemplateOptions(
                    [
                        'area' => Area::AREA_FRONTEND,
                        'store' => $this->storeManager->getStore()->getId()
                    ]
                )
                ->setTemplateVars($variables)
                ->setFrom($this->contactsConfig->emailSender())
                ->addTo($this->contactsConfig->emailRecipient())
                ->setReplyTo($replyTo, $replyToName)
                ->getTransport();

            $transport->sendMessage();
        } finally {
            $this->inlineTranslation->resume();
        }
    }
}

  vendor/module/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Contact\Model\Mail" type="vendor\module\Model\Mail"/>
</config>

It ran into this file, but it failed because some private variables.

Any help? Thank in advance.


texts: How to assign ratio values to two different variables?

texts:
$productRatio = $_productCollection->getRatio();

I got 3:1 , How to assign this to two different variables. 3 should be assigned to $resin and 1 should be assigned to $hardner.
I tried this but am getting error.

$resin:$hardner :: $productRatio ;


texts: No Input File Specified after Applying Patch

texts:
I just installed a couple critical patches and followed the instructions here. http://devdocs.magento.com/guides/m1x/other/ht_install-patches.html

After I ran the following command

chown -R root .

My site not says 'No input file specified.'

I tried reverting the patches and that didn't do anything.

Any Ideas? Do i need to reset the file permissions?

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod 550 mage


texts:
Is there any way to create a "price freeze" that stops the price of items in a quote from changing? Ideally discounts still need to be calculated while shipping price would also be frozen.

Edit:
My definition of "freeze" is that the price should not be updated based on changes to prices of the items contained.


texts: taxamo checkout throws currency_code validation error

texts:
**taxamo api checkout form integration into magento 2.x** :

I am using taxamo api
    checkout form in magento 2.x. below is code. but
    throws error :

  "Validation failed {:transaction {:currency_code missing-required-key}}" error

Taxamo.initialize('public key');
Taxamo.setCurrencyCode('USD');
Taxamo.scanPrices();
Taxamo.detectButtons();
Taxamo.detectCountry();

var transaction = { custom_fields: [{key: "untaxed-plan-id", value: "taxamo_untaxed"},
                    {key: "taxed-plan-id", value: "taxamo_taxed"}],currency_code: "USD",
                    billing_country_code: Taxamo.defaultTransaction.billing_country_code};

var metadata    = { allowed_payment_providers: 'braintree,paypal',
subscription_mode: true,
require_email: true,
show_buyer_name: true,
show_invoice_address: true,
finished_redirect_url: self.location.href
};

var checkout = new Taxamo.Checkout(transaction, metadata);
checkout.overlay(function(data)
{
//you can also use .redirect() here
alert('callbackhandler:' + JSON.stringify(data, null, '\t'));
});


texts: How to validate telephone field in billing information

texts:
I want to apply validation with 10 digit mobile number on telephone field in billing information in magento checkout page.

For this I tried pattern="\d{10}" with type="tel" but it is not working.

How to do that?


texts: How to display instock product first on the category page in magento 2.1?

texts:
I want to display In stock products first and out of stock at end of the listing.

I have used below code in magento/module-catalog/Model

$collection->joinField('stk', 'cataloginventory_stock_item', 'is_in_stock', 'product_id=entity_id', 'qty>=0', 'left')->setOrder('stk','desc');

But I am getting the error:

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): A joined field with this alias is already declared.

How can I solve this issue?


texts:
I need to change only one font icon -the cart icon. I tried a few guides:
https://www.classyllama.com/blog/icon-fonts-magento-2-foundation
http://rossmchugh.com/extending-magento2s-icon-font-system/
http://zanetabaran.com/magento-2-icons-custom-fonts/

but while these are working fine, my problem is that I need to replace all the 34 font icons of the frontend, because it replaces the default font-icon font.
What I need is to expand the default so I can replace one or two only.
any help, please?


texts: My attributes have hundreds of options which are empty/null, is there some sql statement or code to delete all null values?


texts: Magento 2 read more and read less in description product page

texts:
I want to add a read more and read less button in the description on the product page.

I do not want to cut the entire text and onclick of the read more show another div with the entire content.

I want to check the height of the content and add a read more button when the description content is higher than 100px. This should be done by given the specific <div class="value"> always a height of 100px. When clicking on the read more button, it should change the css to heigh 100%.

How can I achieve this?

I want to add this into:

  app/design/frontend/custom/custom/Magento_Catalog/templates/product/view/attribute.phtml


texts: Convert Mage_Customer_Model_Customer Object to an array and convert again to object

texts:
I had encrypted customer's firstname ,lastname and email and need to decrypt data to show in front end.
I will be Overriding public function getCustomer() located at app/code/core/Mage/Model/Session.php file.
Customer Data retrieved from
$customer = Mage::getModel('customer/customer')
            ->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
    $customer->load($this->getId());

UPDATE

When ever i use print_r($customer) to print data of logged in customer i get Mage_Customer_Model_Customer Object.

Problem

I want to replace decrypted value of firstname,lastname and email with an array $customer['_origData:protected'] and $customer['_Data:protected']
since methods are protected so i have converted object into an array and converted again   into an Object after passing decryption function , but converted Object is without protected methods.
I'm getting Fatal Error when converted Object is passed to function  $this->setCustomer($customer);

What I want
Replace three encrypted values  firstname , lastname and email in Object Mage_Customer_Model_Customer Object

Basic Question is :- How to Replace values in an object ?


texts: Download a file from Controller in Magento 2

texts:
I create a Product View Tab and fill this with some PDF download links. Now link in Magento 1.9 I create a controller to prepare the download response.

I don't find any solution to download a file from VAR folder.

In Magento 1.9 I simply call the function $this->_prepareDownloadResponse( ... )

How I do this in Magento 2?

Thanks


texts:
I have an URL like:

base_url/cloths/mens.php

now when we click on this above URL then it should redirect to:

base_url/wp/cloths/mens/

here we want to remove .php extension from URL after redirecting.

Note: we are clicking base_url/cloths/mens.php from Magento but base_url/wp/cloths/mens/ is post of WordPress.

We have written like:

Redirect 301 /cloths /wp/cloths

Here URL is redirecting properly but at the end of URL .php is getting append.

We have also tried this but didn't worked:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

How can we remove the .php part from the URL?


texts: Magento 2 - Exception when clicking on order

texts:
I got this code:

namespace UV\Bestellung\Plugin;

class Buttons
{
    public function beforePushButtons(
        \Magento\Backend\Block\Widget\Button\Toolbar\Interceptor $subject,
        \Magento\Framework\View\Element\AbstractBlock $context,
        \Magento\Backend\Block\Widget\Button\ButtonList $buttonList
    ) {
        if($this->_request->getFullActionName() == 'sales_order_view'){
            $buttonList->add(
                'bestellschein',
                ['label' => __('Bestellschein'), 'on_click' => 'setLocation(\'' . $this->getUrl() . '\')',  'class' => 'ship'],
                -1
            );
        }
    }

    public function getUrl() {
        return $this->getUrl('uv_bestellung/order/print/order_id/' . $this->getOrderId());
    }

    public function getOrderId() {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $id = $objectManager->get('Magento\Framework\Registry')->registry('sales_order')->getId();
        return $id;
    }
}

It adds a button to the order list in adminhtml.

  Sales => Orders

Whenever I click on an order it tries to load it and then a red box appears saying "Exception while loading order".

Anyone knows why that happens?


texts: Error message not displaying in Observer Magento2

texts:
I used below event,

<event name="catalog_controller_product_view">
    <observer name="custom_product_view_layout" instance="Vendor\Module\Observer\CheckProduct" />
</event>

Then in my observer file,

namespace Vendor\Module\Observer;

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

class CheckProduct implements ObserverInterface
{
  protected $_logger;
  protected $_storeManager;
  protected $messageManager;
  protected $productRepository;
  protected $_resultPageFactory;

 public function __construct(
    \Psr\Log\LoggerInterface $logger,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Framework\Message\ManagerInterface $messageManager,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory
) {
    $this->_logger = $logger;
    $this->_storeManager  = $storeManager;
    $this->messageManager = $messageManager;
    $this->_resultPageFactory = $resultPageFactory;
    $this->productRepository = $productRepository;
}

public function execute(Observer $observer) {
    $product = $observer->getEvent()->getProduct();
    if($this->_ciicustomerHelper->isCustomerLoggedIn()) {
        try{
            //Exam Service Api data
            $productSku = $product->getSku();
            $source_sku = $this->checkProduct($productSku);
            if(isset($source_sku) && $source_sku != false) :
                $message = "You can not buy this product";
                $this->messageManager->addError(__($message));
            endif;
          } catch (\Exception $ex) {
                $this->_logger->info("Message ".$ex->getMessage());
          }
    }
    return $this;
 }
 public function checkProduct($productSku){
    $connection = $this->getConnection();
   $sql = "select * from custom_table where sku='".$productSku."'";
   $resultProduct = $connection->query($sql);
   $resultQuery = $resultProduct->fetchAll();

  if(!empty($resultQuery)){
    $parent_sku = $resultQuery[0]['parent_sku'];
    return true;
   }
  }else{
   return false;
  }
  }

}

This is not displaying any error message, can anyone help me on this please what is wrong in the code.

Thanks


texts: How can I add some extra labels for the address in the adminpanel in M1?

texts:
I would like to add some extra labels to html code from the address , like in the image:

Right after the street address I would like to add some labels. Right now I added via jQuery, but I have to change a lot , when there is an address when you want to add a new address etc .

I know that this class method: Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses::initForm is responsible for getting displayed those inputs. And in the customer/tab/addresses.phtml there is a big js, which is also responsabile for it. The fact is that everyhing that I change is a dead end. Is it possible to add those labels ? maybe If I rewrite the block and change smth in it . Any idea how can I do that ?


texts:
where do I add this redis code for it to work in my local.xml?

<cache>
  <backend>Cm_Cache</backend>
  <backend_options>
    <server>127.0.0.1</server>
    <port>6379</port>
    <persistent></persistent>
    <password></password>
    <force_standalone>0</force_standalone>
    <connect_retries>1</connect_retries>
    <read_timeout>10</read_timeout>
    <automatic_cleaning_factor>0</automatic_cleaning_factor>
    <compress_data>1</compress_data>
    <compress_tags>1</compress_tags>
    <compress_threshold>20480</compress_threshold>
    <compression_lib>gzip</compression_lib>
    <use_lua>0</use_lua>
  </backend_options>
</cache>

here is my local.xml:

config
global, are not showing but they are there.

`

    <install>
        <date><![CDATA[Thu, 13 Nov 2014 16:42:08 +0000]]></date>
    </install>
    <crypt>
        <key><![CDATA[**************************]]></key>
    </crypt>
    <disable_local_modules>false</disable_local_modules>
    <resources>
        <db>
            <table_prefix><![CDATA[]]></table_prefix>
        </db>
        <default_setup>
            <connection>
                <host><![CDATA[localhost]]></host>
                <username><![CDATA[appuser]]></username>
                <password><![CDATA[**********]]></password>
                <dbname><![CDATA[******]]></dbname>
                <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                <model><![CDATA[mysql4]]></model>
                <type><![CDATA[pdo_mysql]]></type>
                <pdoType><![CDATA[]]></pdoType>
                <active>1</active>
            </connection>
        </default_setup>
    </resources>
    <session_save><![CDATA[files]]></session_save>
</global>
<admin>
    <routers>
        <adminhtml>
            <args>
                <frontName><![CDATA[g******]]></frontName>
            </args>
        </adminhtml>
    </routers>
</admin>

`


texts: Move product toolbar in another phtml file

texts:
In Product listing page I've created a block and it's content coming from phtml file. So I wish to move product toolbar in it, so I've write following code in catalog_category_view.xml of my custom theme but it didn't work.

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="columns" htmlClass="columns container">
            <block class="Magento\Catalog\Block\Category\View" name="category.toggle" template="Magento_Catalog::category/toogle.phtml" before="main" />
        </referenceContainer>
        <move element="product_list_toolbar" destination="category.toggle" after="-" />
    </body>
</page>

Any guesses what am I doing wrong ?


texts:
I'm getting lots of fake customer signup with .ur email addresses and Russian charters. I suspect there are be.

Is it possible to change the default signup URL?


texts:
I have one category "A". Category A has two sub-categories B and C.Category A is coming in top menu under which two subcategories B and C are also coming. Its fine.

Now I want to remove anchor tag from category A but keep on B and C. How can this be achieved?


texts: $_product->getProductUrl() giving url path without URL key

texts:
I am getting a product collection of a certain category on a page in a few different Magento sites. My code for getting the collection is:

        $category = new Mage_Catalog_Model_Category();
        $category->load($id);
        $collection = $category->getProductCollection();
        $collection->addAttributeToSelect('*');
        $collection->addAttributeToFilter('status', 1);
        $collection->addFieldToFilter(array(array('attribute'=>'visibility', 'neq'=>"1" )));
        $collection->getSelect()->limit(12);

        foreach ($collection as $shopProduct) :

            echo $shopProduct->getProductUrl();

        endforeach;

My problem is that on one of the Magento sites we're running the ProductUrl() being fetched is a URL like http://www.my site.com/catalog/product/view/id/2309/s/shopcat/category/373/ and not more like http://www.site.com/shopcat/product-url-key.html. But on all other sites it's appearing as we want it.

Does anyone know why this might be? Thanks! I tried using getUrlPath() too but this didn't return anything. I know I can get round this by doing something like <?php echo $this->getBaseUrl().$shopProduct->getUrlKey().".html"; ?> but that method seems a bit inefficient!

EDIT 21/03/14: I'm still having this problem. I've realised getProductUrl() retrieves the wanted URL on some template files of the site but not others. For example, I'm loading one collection on the homepage and it's giving me the URLs I want. But getProductUrl() is not giving me the URLs I want with the same code on a category view.


texts: Color swatch and text swatch issue in magento 2

texts:
If I used color and text swatch in magento 2, sequence/order of option isn't changing. I mean I want to show

1. size
2. color

but it always show

1. color
2. size

if I used dropdown instead of color and text swatch. it is working fine.
Can anyone tell me, is that isssue comes with magento 2.0?


texts: Creating new theme, Copy Magento 2 luma theme

texts:
I have created a new magento 2 theme by copying luma theme. The issue I have is though I have created the theme by coping luma including all directories and files including layout, css, less, js, phtml, but the theme is not a replica of luma.

Static blocks are not showing on home page (banners, products not is showing up), header, footer and styles are not showing.

I have done everything, i.e. reindex, flush cache, regenerated static content but nothing is working.

I know I can extend luma theme, but I want to create a new theme based on blank theme.


texts: How can I create thousands of associated products?

texts:
My configurable product has four attributes - each attribute has up to 36 options resulting in thousands of options for the customer to choose from.

How can I create all the associated products without doing it one by one?

Or is there a better way to make all the choices available?


texts: Having issue with implementing a custom maintenance page in Magento 2. I have followed the suggested config for nginx per Devdocs and combined it with the sample nginx config that comes with the magento install. For whatever reason the homepage is never redirected to the maintenance page, however all other links seem to redirect properly. Any help is appreciated.


texts: Magento API - add new custom option value

texts:
I'm integrating Adempiere with Magento
Synchronizing Products , i want to create a custom options but im getting error

XML-RPC Error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'price_type' cannot be null, query was: INSERT INTO `catalog_product_option_type_price` (`option_type_id`, `store_id`, `price`, `price_type`) VALUES (?, ?, ?, ?)

i have given the value Product_DATA.put("price_type", "percent");
code:

 public int CreateCustomOptions(String sessionid,Integer product_id,String Option,String o_value , String o_sku, String price)
 {
        HashMap Product_DATA = new HashMap();
        Product_DATA.put("title", o_value);
        Product_DATA.put("price",price);
        Product_DATA.put("price_type", "percent");
        Product_DATA.put("sku", o_sku);

        Vector ARGS = new Vector();
        ARGS.add(sessionid);
        ARGS.add(new String ("product_custom_option_value.add"));
        ARGS.add(new Object[] {110,Product_DATA});
        this.newRequest(remoteHost, "", sessionid, "call", ARGS);
         Object RESULT = (Object) this.sendRequest();
}


texts: Rewriting the product resource collection doesn't take effect on tag product collection

texts:
I need to add a method to the collections of products in magento, the base model which seems to be the parent of all the collections (e.g. Mage_Tag_Model_Resource_Product_Collection) is

Mage_Catalog_Model_Resource_Product_Collection

I rewrote this collection and added the methods I needed like:

class Mycompany_Catalog_Model_Resource_Product_Collection extends
Mage_Catalog_Model_Resource_Product_Collection
{
  public function sortBySalesTimesProfitTimesCommission(){
    //blah blah blah
  }
}

And including the xml configs it works. But now, when I use the collection in the tag page it is of the type

Mage_Tag_Model_Resource_Product_Collection

Which inherits from the Mage_Catalog_Model_Resource_Product_Collection. and the parent is not rewritten.

Is there any way to rewrite the parent? Or any other approach which doesn't make me copy the method sortBySalesTimesProfitTimesCommission and keep it unique in the code to avoid breaking the DRY principle?


texts: Magento 2 : Need to import product image from external url

texts:
I just need to import all product images from external url , can i able to do this using default functionality in magento 2.

If yes, how can i use this product images external url during import csv file in magento ?
is there any setting , please share your if anyone have idea


texts: What is load method in magento 2 model how it's works with magento 2 model

texts:
i have doubt in
Magento 2 Model
when i use this in some places not getting brand value (Graphql Resolver) like cart details
  $product=$value['model'];

  $brand=$product->getAttributeText(self::BRAND_ATTRIBUTE_CODE);

but
when i use like this
if($brand===false){
            $product->load($product->getId());
            $brand=$product->getAttributeText(self::BRAND_ATTRIBUTE_CODE);
        }

i am getting expected value
what happening behind the load () in model
and how it's works ?
(Is there any disadvantages there)
Thanks in advance


texts: The "Product Prices" and "Product Attributes" index depended on stock index?

texts:
I found that on a client server, the stock index run cause a heavy load and slow down the site, so I changed the stock index to manually.

After I changed "stock status" index to manually mode, every time I saved a product, the "Product Prices" and "Product Attributes" always required a re-index. I found the config:

            <catalog_product_attribute>
                <depends>
                    <cataloginventory_stock/>
                </depends>
            </catalog_product_attribute>
            <catalog_product_price>
                <depends>
                    <cataloginventory_stock/>
                </depends>
            </catalog_product_price>

on app/code/core/Mage/CatalogInventory/etc/config.xml

So I removed (commented out) that xml part and those two indexers seem ok, but could anyone explain for me what the  tag for? just the order for indexers to run or something deeper than that? is it safe to remove those  sections?


texts:
I am following these directions: https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-magento/

The site is running Magento 1.9.3.2, I'm a PHP developer, but haven't used Magento before, it's hosted by magemojo.com.

I've followed the directions but when I visit "Configuration" there is no Mailchimp configuration menu.

I've copied the files into their corresponding folders, I've checked the permissions, I've cleared the cache, I've re-uploaded the files, I've logged out and logged back in. I've done all of these things multiple times.

The Magento Connect Manager 404's which I think might have been intentional for security reasons, but I can't figure out how exactly.

I'm not sure exactly what to try next, so any help would be great. I've backed up the site and have ftp (port 21) access to the site. It doesn't look like it uses source control, but I've put my back up in git and have commits before and after installing MailChimp.


texts: Why are quotes not converted to is_active=0 after checkout? M1/M2

texts:
When looking at sales_flat_quote (M1) or quote (M2) table, there are many quotes stuck at is_active=1. Even though there is a sale in sales_flat_order / sales_order.

This does not seem to have a relation to the state of the order (finding complete/processing/canceled orders), nor payment method (finding paypal, checkmo and 3rd party gateway orders).

When joining the quote and sales tables to find orders with 'open' quotes, I find many results on several shops that we manage.

I'm using this query on M1:

SELECT `sales_flat_order`.`state`,
       `sales_flat_order`.`increment_id`,
       `sales_flat_order`.`entity_id`,
       `sales_flat_order`.`created_at`,
       `sales_flat_order`.`quote_id`,
       `sales_flat_quote`.`is_active`,
       `sales_flat_quote`.`customer_email`,
       `sales_flat_order_payment`.`method`
FROM `sales_flat_order`
LEFT JOIN sales_flat_quote ON `sales_flat_order`.`quote_id`=`sales_flat_quote`.`entity_id`
LEFT JOIN `sales_flat_order_payment` ON sales_flat_order.`entity_id`=sales_flat_order_payment.`parent_id`
WHERE `sales_flat_quote`.`is_active` = 1;

and this one on M2:

SELECT `sales_order`.`state`,
       `sales_order`.`increment_id`,
       `sales_order`.`entity_id`,
       `sales_order`.`created_at`,
       `sales_order`.`quote_id`,
       `quote`.`is_active`,
       `quote`.`customer_email`,
       `sales_order_payment`.`method`
FROM `sales_order`
LEFT JOIN quote ON `sales_order`.`quote_id`=`quote`.`entity_id`
LEFT JOIN `sales_order_payment` ON sales_order.`entity_id`=sales_order_payment.`parent_id`
WHERE `quote`.`is_active` = 1;

Am I looking at this the wrong way? Can people confirm the same thing for their M1/M2 shop?


texts: Invalid URI error after moving Magento but no underscore in URL

texts:
I have recently migrated my site to a new dedicated server and as part of the move have updated the URL to a new one.

I am getting an invalid URI error and have searched the forums and the wider web but only find references to URLs with underscores in them.

Neither the old URL nor the new URL contain any underscores but I get the following error when trying to access any page:

There has been an error processing your request

Invalid URI supplied

Trace:

#0 /var/www/vhosts/unitymedia-dev.co.uk/elmers.unitymedia-dev.co.uk/lib/Zend/Uri.php(143): Zend_Uri_Http->__construct('http', '//elmers.unitym...')
#1 /var/www/vhosts/unitymedia-dev.co.uk/elmers.unitymedia-dev.co.uk/app/code/core/Mage/Core/Model/Store.php(726): Zend_Uri::factory('http://elmers.u...')
#2 /var/www/vhosts/unitymedia-dev.co.uk/elmers.unitymedia-dev.co.uk/app/code/core/Mage/Core/Controller/Varien/Front.php(313): Mage_Core_Model_Store->isCurrentlySecure()
#3 /var/www/vhosts/unitymedia-dev.co.uk/elmers.unitymedia-dev.co.uk/app/code/core/Mage/Core/Controller/Varien/Front.php(161): Mage_Core_Controller_Varien_Front->_checkBaseUrl(Object(Mage_Core_Controller_Request_Http))
#4 /var/www/vhosts/unitymedia-dev.co.uk/elmers.unitymedia-dev.co.uk/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 /var/www/vhosts/unitymedia-dev.co.uk/elmers.unitymedia-dev.co.uk/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#6 /var/www/vhosts/unitymedia-dev.co.uk/elmers.unitymedia-dev.co.uk/index.php(87): Mage::run('', 'store')
#7 {main}

The url I am trying to set it up on is: http://elmers.unitymedia-dev.co.uk/

I have changed the urls in the core config data table to the new url and checked there are no random spaces or characters, but it still won't have it.

If someone could help it would be really appreciated.

Thanks


texts: adminhtml URL generation from admin and shell script

texts:
I'm creating a module that sends data to a custom API when creating an order and/or customer and when one of them changes. It also holds a magento shell script to send initial data. The contents of the shell script is just a simple wrapper of the module.

As I'm testing the module, it seems that shipment view urls generated from the admin page do work, but the very same code generates a different, not working, url when ran from the shell script. The code that generates the order view url works in both cases.

Here is the code that generates the shipment view url and is used in the event listeners as in the shell script

/**
 * @param $shipment
 * @return mixed
 */
private function getShipmentUrl($shipment)
{
    $shipmentId = Mage::getModel('sales/order_shipment')
        ->loadByIncrementId($shipment->getIncrementId())
        ->getId();
    $this->logger->log($shipmentId);
    return Mage::helper('adminhtml')
        ->getUrl(
            'adminhtml/sales_shipment/view',
            array('shipment_id' => $shipmentId, '_type'=> Mage_Core_Model_Store::URL_TYPE_WEB));
}

There are urls generated from this code, the only difference is the key part.
This url is generated when the event gets fired: /admin/sales_shipment/view/shipment_id/33/key/ee1409fa12d53056b2cf4fdf691e1a7c/
and this url is generated from the shell script: /admin/sales_shipment/view/shipment_id/33/key/5610bd5ecf1d0e67b3e752b0ae026e7f/

As I understand the key has to be in the sessions. If this is true, than the view order url code should also generate a not working url when the shell script gets executed, but this is not the case.


texts: How to get a each product id in category page in Magento 2?

texts: How to get a each product id in category page? I need to get the product id in custom module template file.


texts:
I activated JS/CSS merging, which resulted in 75 less requests and 3-5 seconds faster page load. But the agency which works with my company claims that merging is a big error source and we should not activate it, because they have had bad experience with it.

However, the same company claimed that activating merging is a lot of work and they wanted a lot of money for doing it, even though it is two checkboxes, so I'm not sure if I can trust them.

What are the pros and cons of activating JS/CSS merging?


texts: Magento - best practice to call functions from extension to view.phtml

texts:
I have the Magento in Version 1.9

Now I want to call some functions from my extension in product/view.phtml

My custom extension fetch data from Database and build some html fields, now I want to display in view.phtml.

Can you tell me, what is the best practice, because I have read that Helpers are not efficient for that.


texts: Magento 2 Add to Cart : Performance testing using Jmeter

texts:
We are doing performance testing on Magento 2 platform.

How should we include following URL in jMeter script

cart/ad/uenc/aHR0cHM6Ly9wcm9kLWFiYm90dC1zdG9yZS1leHRlcm5hbC1hbGIuYWJib3R0c3RvcmUuY29tLzE0LTFvemNhbi1jYXNlb2Y2LTU1MjUxLmh0bWw,/product/153/


texts: Magento 2.2. with Varnish, Contact form not working

texts:
I am trying to test the contact form, but varnish is giving me 503 errors every time I am trying to submit the form. However, I don't think varnish is the issue here.

I am calling the form using the below cms-code:

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}


texts: Magento adding products locally and migrating it to production

texts: I have setup a test Magento environment locally and i push the changes to production using a git repository. However when i add products using the production admin dashboard the product images doesn't get added to the repo as i'm not committing changes from production environment. What are the best practices to do admin panel changes when you have several magento environments? And also if i add the products locally what is the best practice to migrate the product info from the local database to production?


texts: Magento : Shipping rules takes grand total excluding taxes for Subtotal

texts:
I use shipping rules to set up a list of different post options. I had to create two rules in order to provide free shipping for all orders within UK over £60. So I created these two rules.

Rule one:
 If ALL of these conditions are TRUE: Subtotal less than 60.00 Shipping Country is one of United Kingdom

Rule two:
 If ALL of these conditions are TRUE: Subtotal greater than or equal to 60.00 Shipping Country is one of United Kingdom

But I noticed that the shipping cost still appears on some orders with total over £60 and within the UK. I looked into it and noticed that when Grand total Excl. Tax is under £60 rule one is applied and with the shipping cost and when Grand total Excl. Tax is over £60 rule two is applied and with out the shipping cost.

What confused me the most is that it says cart subtotal when you set up rules. I wonder what could be a possible solution for such problem?


texts: How to create order programmatically with customer email in magento 1.9

texts:
I  want to place order with customer email id in magento 1.9
For this i need a script means i want to do it programmatically in php
Please help asap


texts: How to change the text of the sign in button on the top header of a magento store

texts:
I am currently developing my first Magento website and the whole functionality behind is overwhelming so I might have overseen the possibility to fulfill the task.

I am looking for a way to change the text of the top menu which can be seen on this page: http://sndev.calapo.at/

On the top right we can see two links "Sign In" and "Create an Account" I would like to rename those into "Login" and "Register" - how can I do that?


texts: Magento 2 - Change amount of products per row in category view

texts:
Currently there are showing 4 products per row in the category view.
How can I make it show 3 products per row instead?
I found this answer. It says there is a file Magento_Catalog\web\css\source\module\_listing.less but I searched in vendor\magento\module-catalog\view\frontend\web folder and there is not even a css folder inside of it.


texts:
Today i am trying to explain to my friend that how many technologies are used in magento and i am searching for list of technologies used in magento but couldn't find it so i prepare a list of things by myself that requires to learn and understand magento (language, pattern, framework) but i am missing something here

Here is the list

Php

Css

JavaScript

Sql

jQuery

Bootstrap

Zend

Symphony

Xml

Oops

Mvc

EAV

Mvvc

Prototype

Required Js

Knockout js

Ui components

Composer

CSS preprocessing

Less

This list is not complete can you help me to complete this list

It would be great if list of technologies are separate for Magento and magento 2


texts: Check if product has custom options Magento 2

texts:
I want to display some text next to the price of a product if it has custom options. I have placed some code in final_price.phtml but it doesn't show the message on custom option products.

Can anyone please advise an update to the below to get this working?

<span class="special-price">
    /** Show text if has custom option */ <?php if ($block->hasOptions()):?>
        <?php echo ('from'); ?>
    <?php endif;?> /** Show text if has custom option */
    <?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getAmount(), [
        'price_id'          => $block->getPriceId('product-price-' . $idSuffix),
        'price_type'        => 'finalPrice',
        'include_container' => true,
        'schema' => $schema
    ]); ?>
</span>


texts:
a:4:{i:0;s:55:"Module "Mage_Newsletter" requires module "Mage_Widget".";i:1;s:758:"#0 /home2/ulashlvw/public_html/app/code/core/Mage/Core/Model/Config.php(851): Mage::throwException('Module "Mage_Ne...')
#1 /home2/ulashlvw/public_html/app/code/core/Mage/Core/Model/Config.php(815): Mage_Core_Model_Config->_sortModuleDepends(Array)
#2 /home2/ulashlvw/public_html/app/code/core/Mage/Core/Model/Config.php(318): Mage_Core_Model_Config->_loadDeclaredModules()
#3 /home2/ulashlvw/public_html/app/code/core/Mage/Core/Model/App.php(425): Mage_Core_Model_Config->loadModules()
#4 /home2/ulashlvw/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#5 /home2/ulashlvw/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#6 /home2/ulashlvw/public_html/index.php(83): Mage::run('', 'store')
#7 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}


texts: Magento 2 - How to get JSON response from Controller

texts:
I've created my custom controller and I want to return the result formated with JSON. I always get a JSON: []

Route:

 <route url="/V1/points/get" method="GET">
    <service class="module\Points\Controller\Points" method="get"/>
    <resources>
        <resource ref="anonymous"/>
    </resources>
</route>

Controller:

class Points extends Action implements \module\Points\Api\PointsInterface {
   protected $request;
   protected $resultJsonFactory;

protected $_pointFactory;

public function __construct(
    Context $context,
    \Magento\Framework\App\Request\Http $request,
    \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
    \YellowOctopus\Points\Model\PointFactory $pointFactory
)
{
    parent::__construct($context);
    $this->request = $request;
    $this->_pointFactory = $pointFactory;
    $this->resultJsonFactory = $resultJsonFactory;
}

/**
 * @return \Magento\Framework\Controller\Result\JsonFactory
 */
public function get()
{
   try {
      (...)
//$result = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_JSON);
        return $this->resultJsonFactory->create()
         ->setData([
            'act' => 'success',
            'totalResults' => 16,
            'results' => [],
        ]);
    } catch (\Exception $e) {
        $result = $this->resultJsonFactory->create();
        return $result->setData([
            'act' => 'error',
            'm' => $e->getMessage(),
        ]);
    }
}

/**
 * @return \Magento\Framework\Controller\Result\Json
 */
public function execute() {}

Request:
GET: .../rest/V1/points/get?lat=50.164001&lng=-5.069998&distance=1500

Response (Postman):
https://prntscr.com/hg738w.jpg


texts:
I have tow website.One of them has problem with currency that is doesn't appear with some item in homepage  and shopping cart
Any body can help me.


texts: Update product custom option price on product price change

texts:
Background

Currently I have a product with a few custom options and all are radio buttons. Each of the rows in the options are priced based on percentage. On the frontend everything is displayed as you would expect:

The custom options prices are based off of the price defined in the product.
When you select one of the options it adds the price of the option and the base price.

I have an extension installed called Custom Math Pricing (https://www.micosolutions.com/custom-math-pricing) with this extension I am updating the product price on the frontend based on numbers entered in a custom option (text field type) which goes through a formula I created in the extension.

My problem

When the product price is updated on the frontend the custom option's (radio buttons) prices are not.

What I'm expecting

When the product price changes the custom options prices with percentage pricing should recalculate percentage based off of the new product price. For example, if the initial product price is $1.00 and the custom option price is 90% then the custom option price is $0.90. When the product price updates to $10.00 the custom option price being at 90% should now show $9.00 instead of staying $0.90(the price based off of the initial price).

Questions

Am I able to see the custom option row percentage on the frontend?
Is there a frontend javascript class that I can use to update the custom option price on the frontend or do I need to create this?


texts:
I am importing orders from a 3rd party application, and I need to be able to set a custom shipping amount, ignoring everything in Magento.

Here's what I tried, without success:

$quote           = Mage::getModel('sales/quote')->setStoreId($storeId);
$shippingAddress = $quote->getShippingAddress();

$shippingAddress
    ->addData($addressDetails['shipping']) // shipping data I need to save - city, region, etc
    ->setCollectShippingRates(true)
    ->collectShippingRates()
    ->setShippingMethod('tablerate_bestway')
    ->setPaymentMethod('cashondelivery');

$shippingAmount = mt_rand(0, 20); // value doesn't matter

// basically everything I found related to the price in the shipping address
$shippingAddress->setBaseShippingAmount($shippingAmount);
$shippingAddress->setShippingAmount($shippingAmount);
$shippingAddress->setTotalAmount('subtotal', $shippingAmount);
$shippingAddress->setData('shipping_incl_tax', $shippingAmount);
$shippingAddress->setData('base_shipping_incl_tax', $shippingAmount);
$shippingAddress->setData('shipping_taxable', $shippingAmount);
$shippingAddress->setData('base_shipping_taxable', $shippingAmount);
$shippingAddress->setData('shipping_amount_for_discount', $shippingAmount);
$shippingAddress->setData('base_shipping_amount_for_discount', $shippingAmount);

// maybe the rates have something to do with this ...
foreach ($shippingAddress->getShippingRatesCollection() as $rate) {
    $rate->setPrice($shippingAmount);
}

Regardless of the value of the shipping amount I want to set, the Magento calculated value is used.

What am I missing ?


texts: Is it possible to apply validations by `class` in M2 like in M1?

texts:
I was wondering if it is possible to apply validation to a field in a similar way to M1:

Validation.add('validate-email', 'Please enter a valid Gmail address. For example johndoe@gmail.com.', function(v) {
    return Validation.get('IsEmpty').test(v) || /^([a-zA-Z0-9]+[a-zA-Z0-9._%-]*@gmail\.com)$/i.test(v)
})

So that this validation would be applied to all fields with the class of validate-email.

I am asking because I find that KO validations are really inflexible and I haven't found a way to change anything about them once the page is loaded.


texts: order_totals in sales email template being wrapped in a table

texts:
I'm trying to modify the layout a bit for the "new sale" email, specifically the order totals area. From the sales.xml file, I see that there's 4 templates being used:

email/order/items.phtml

email/order/items/order/default.phtml

email/order/totals/wrapper.phtml

sales/order/totals.phtml

In items.phtml the order_totals block gets called by echo $this->getChildHtml('order_totals') which then seems to load the template from wrapper.phtml. The problem that I'm having right now is that the call to getChildHtml() seems to wrap the contents from wrapper.phtml in another table, which I can't seem to find in the templates at all. Unfortunately, this is the table that I need to make modifications to. Does anyone know if that's in an actual template or is magento building that table dynamically? If it is dynamic, is there a way to add information to the table like whats being done in sales.xml with action methods like setLabelProperties? Any direction or advice would be greatly appreciated. Thanks for your help!


texts: Magento 2.3.1 MSI(Multi Stock Inventory) needs to disable

texts: I have done the upgrade in one of the customer live projects from Magento 2.2.2 to 2.3.1 but not required MSI feature. Is it possible to disable all MSI modules in config.php? Once all the MSI modules disabled and it causes any issues?


texts: Make a Popup window showup on clicking a html link

texts:
I need to make a popup window come up when user clicks on a html link.

Basically I'm trying to make users see a bigger picture of a wrapping paper for products.

I'm not very familiar with Javascript so any help on how to solve this step by step is welcome.


texts:
Let's say I do the following:

$favorite = Mage::getModel('testing/favorites')->load(4);
.....
$favorite->save();

How do I make sure the row 4 has been locked and can't be accessed until I call save()?

Edit:

Essentially, I have one table with a column (not id column, not autoincrement) that is a counter, which increments every time a call is made to a function. If two people access this row concurrently, how can I make sure the value is +2 at the end, and not +1?

For example:
User A and B call

  incrementAction(4);

If the row 4 has a favorite_count = 500, it should, by the end, have a value of 502. The +1 from user A, and the +1 from user B, rather than each incrementing 500 for each +1  and ending up with 501 when each of them calls save().


texts: Magento 2 giving error while creating New Module In PathValidator.php line 63:

texts:
I am creating a new module in Magento 2
when I run the command

bin/magento module:enable Module_Name

it's giving following error

Path "/var/www/vhosts/magento2-blank/app/etc/" cannot be used with directory "/var/www/vhosts/magento2-blank/app/etc/"

can anyone have the same problem?


texts:
I would like to add advanced catalog search on the home page.
So to speak instead of one field I would like to have 3 fields and do a combined search.

How can I do this?


texts: Magento 2.3.1 manage stock = no but showing only 0 left

texts:
I have turned on the feature in Magento that shows only x remaining when the stock is less than 5 which works fine.

However on products that are set to stock manage = no, it's showing there's only 0 left which isn't true as it's set to not stock manage.

I've found it's bringing it in because of this function $block->isMsgVisible() in module-catalog-inventory

When I look at that function it's simply doing the following

    public function isMsgVisible()
{
    return $this->getStockQty() > 0
        && $this->getStockQtyLeft() > 0
        && $this->getStockQtyLeft() <= $this->getThresholdQty();
}

Which doesn't take into consideration the fact it's set to stock manage = no.

How would I add in a check to see if it's stock manage = yes or no? I've tried a couple of things with no luck.


texts: Configurable product is showing varation for for first time but then variation is not shown

texts:
I am facing a weird problem , the configurable product is  showing variation
Some products are showing variations and some are not
they are having same attributes filled up at the backend
Kindly guide if you know why this is happening ?
also we are using varnish and want to disable it but don't know how?


texts:
I have a Magento site where we currently do an auth and capture at time of order.  We want to be able to offer back orders but to do that we want/need to make the payment method do an auth only and then capture at time of shipment.

We used Authorize.net and was thinking that I could replicate the existing Authorize.net payment gateway code and make all the neccessary code changes so that it showed up as a new payment method, something like Authorize.net (Back Orders).

When there is no back order product in the cart the Authorize.net (Back Orders) option would not be avaialbel but if there is any back order item in the cart then the Authorize.net (Back Orders) would be the only option available.

So I was just wondering if this makes sense or if there is an easier way of doing this?


texts: How to get my table where my session data stored

texts:
i have stored my data in my magento database using

<session_save><![CDATA[db]]></session_save>

my question is that in which table my data store in my database.


texts: Order status doesn't change to "Complete" after shipping and invoicing

texts:
I'm having this issue on Magento 2.2.4:

We're using for the store only one payment module (Mercado Pago), which has many different payment methods, when the customer pays with credit card as payment method, the order goes through the whole process with no problems, but when they pay with "Pagofacil" (one of the other payment methods of the module) the order stays in "Processing" status.

I've checked every order with this problem and all of them have invoice and have been shipped, also, they still have the "hold" option, so they're not on hold.

I thought it might be something with the payment method "Pagofacil", but the same issue happens with one order paid with credit card, only that in this case, the first time the payment was rejected and after a second try it was accredited but it remained in "Processing" status (Invoice and shipping completed).

I hope you can help me, thanks!


texts:
I'm trying to add product's custom option to cart programmatically using event

  controller_action_predispatch_checkout_cart_add

In my observer function I'm not able to to get product object using following methods

  $observer->getProduct()->getId();

or

  $observer->getEvent()->getProduct()->getId();

Though I'm getting product Id using

  $obsPId = Mage::app()->getRequest()->getParam('product')

Check Details here.

Now I've created product object using

$product = Mage::getSingleton('catalog/product')->load($obsPId);

I've created product's additional custom option in array

$additionalOptions = array(
                        'label' => $sareeLabel,
                        'value' => $sareeOptionId,
                    );

Now issue is here:
Code being used to add additional option to product

$product->addOption(array(
                        'code' => 'additional_options',
                        'value' => serialize($additionalOptions),
                    ));

Error: Fatal error: Call to a member function getId() on a non-object in Magento's core model Product.php.

I've also tried using observer
$observer->getProduct()
    ->addCustomOption('additional_options', serialize($additionalOptions));

but it gives Fatal error: Call to a member function addCustomOption() on a non-object in my observer's function.

Questions:

Is it normal in Magento that below observer functions won't work on controller_action_predispatch_checkout_cart_add event?
$observer->getProduct()->getId(); $observer->getEvent()->getProduct()->getId();
In my above code, how I can add custom options to cart?


texts: Access denied for the new user role created in admin side in magento 2.1.7

texts:
I have created new user with some roles assigned, then when trying to login with the new user credentials then giving me the below error

Please if anyone has ever faced this kind of issue let me know the solutions thanks in advance


texts:
I'm trying to add some content of my block into the sales/order/history part.

I have this:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="sales.order.history">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">My_Module::history.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

My_Module::history.phtml is adding some text just for the moment, but I want to add content that is on my block. How can I do that ?


texts: How can i rewrite my category url for redirect new site

texts: How can i configure category url rewrite management. When user click category it leads to another site.


texts: Solved: Checkout cart components loading weird

texts:
we have a serious problem with the cart-view in our shop: https://www.murergrej.dk/checkout/cart/

Problem 1: Not all buttons are clickable anymore.
Problem 2: The message "Free shipping" is shown all the time.
Problem 3: The right sidebar is missing its content, which is the overview of the different prices, the calculation of the shipping price and the possibility to add a discount code.

Situation:
We had the website on a development server and moved it to the live server. The problem wasn't on the dev-server present.
All JS files seem to be loaded and we can't identify any relevant error messages, what makes debugging really uncomfortable.
What I tried so far:

Deactivating modules installed after we moved
Disable custom JS
Switch from production back to development mode
Deploy, deploy, deploy (of course with setup:upgrade, di:compile, cache:clean/flush)
Reindex (what shouldn't do any difference)

Any new perspective/idea on how to approach the debugging would be a great help.
Thank you very much!
Robert
EDIT
A module from a third party was altered by them, which caused the error. I will contact them, so that they fix the bug.
It is/was caused by cached jquery-data.


texts: In Magento 2, how to create promo rule for buy one get one in backend for specific custom attribute?

texts:
I am trying to create promo cart rule in magento 2 backend for a specific attribute product in cart for buy 1 and get 1 with reference of default promo buy 3 get 4th free.

but It is not working as expected.

Can someone tell me how we can achieve this and what should be the condition/action exactly to be set for this rule?

when I check for two qty of my same product for which attribute is set in promotion rule, it is showing discount for 1 product which is fine.
when I add one other product in cart it is still fine.
But when I add two qty of other product, for which attribute is not set,
then also it is applying rule to that product and discount is getting added
in the cart, which should not be the case.

This is quite weird. Can someone check and let me know, what I am missing here?


texts: Hey I am using hozmegamenu in my application. The site was working before but now when I click on the items in the megamenu

texts:
I get this error
2 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Plazathemes\Recentproductslider\Block\Products
Exception #1 (ReflectionException): Class Plazathemes\Recentproductslider\Block\Products does not exist
I tried to check the code but wasn't able to find anything to fix this.
any suggestions?


texts: Home Page OwlCarousel How To Control What Products To Display

texts:
I have two OwlCarousel on the Home Page, but don't see any thing on the backend that allow me to control what products I would like to display on these two.

The way this OwlCarousel is setup to display is CMS -> Page -> Home -> Content

{{block type="ultimo/product_list_featured" template="catalog/product/list_featured_slider.phtml" category_id="101" product_count="12" hide_button="1" block_name="Featured Products"}}
{{block type="ultimo/product_list_featured" template="catalog/product/list_featured_slider.phtml" category_id="100" product_count="12" hide_button="1" block_name="New Products"}}


texts: How to display the custom module on home page in magento 2?

texts: I have custom module by calling the controller in url address bar. How to display the custom  module in home page. Should i create block?. How to call below or above the content.


texts: Moving Short Description Text into Long Description Area On Product Page

texts:
I'm attempting to move my product's SHORT description into my long description, without merging the two during import. I attempted to move the following code into my description.phtml file, but it just breaks the page at the description area.

<?php if ($_product->getShortDescription()):?>

<?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>

<?php endif;?>

Any idea how to effectively move the short description to just above the main description area? Do I need to do anything with the XML code?


texts: website not showing in google - need help with magento admin key search words

texts:
It has taken 7 months for my website to finally work properly.
I have had problem after problem from developers and now that it's up and running I still do not know how to use Magento properly. I need help with my meta keywords. If someone can please help me. My website is www.glamoroushairstyles.com.au
I have tried to put in as many key search words as possible. I go into google and put in "ladies wigs" Australia. My website doesn't even show up.
When I put glamorous hairstyles in google it shows up on the first page.
The problem is When a customer puts in the search word "wigs" (which is the product I am selling) my website is not showing at all.

Can someone please tell me where in admin do I change these details from google.
I need to change this.

see link below:

https://www.google.com.au/#q=glamorous+hairstyles+australia

Glamorous Hairstyles - Finest Collection of Wigs and Hair ...
glamoroushairstyles.com.au/

At Glamorous Hairstyles you will be satisfied with our Service, Quality and ... Glamorous Hairstyles invites you to our Elegant and Stylish Collection of Fine Wigs.


texts: Magento 2 : How to show on product page, how many times product has been added to wishlist in single store

texts:
On product detail page how many times a particular product has been added to Wishlist for simple product and configurable product in single store environment?

Trying below mentioned code:
Di.xml is as follows:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Block\Product\Image">
        <plugin name="Wishlist_Count::Count" type="Wishlist\Count\Plugin\Catalog\Product\Wishcount"/>
    </type>
</config>

Wishlist\Count\Plugin\Catalog\Product\Wishcount file code

namespace Wishlist\Count\Plugin\Catalog\Product\View;
class Wishcount
{
    protected $_helper;
    protected $scopeConfig;

    public function __construct(
        \Wishlist\Count\Helper\Data $helper,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
    ) {
        $this->_helper = $helper;
        $this->_scopeConfig = $scopeConfig;
    }
    public function afterToHtml(
        \Magento\Catalog\Block\Product\View\Gallery $subject,
        $result
    ) {
        $product = $subject->getProduct();
        $template = $subject->getTemplate();//view/frontend/templates/product/view/gallery.phtml
        $name = $subject->getNameInLayout();
        if ($product && $name == "product.info.media.image") {
            $result .= $this->_helper->renderWishlistCount( $product );
        }
        return $result;
    } }

Helper class code is as follows:

namespace Wishlist\Count\Helper;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Store\Model\ScopeInterface;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    protected $_storeManager;
    protected $_counts;
    protected $_registry;
    protected $_resultPageFactory;
    protected $_objectManager;
    protected $_messageManager;
    protected $_scopeConfig;
    protected $_statusId = null;
    private $layoutFactory;
    private $_productTypeConfigurable;

    public function __construct(
        \Magento\Framework\Registry $registry,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Framework\Message\ManagerInterface $messageManager,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\View\LayoutFactory $layoutFactory,
        \Magento\ConfigurableProduct\Model\Product\Type\Configurable $catalogProductTypeConfigurable,
        \Magento\Framework\App\Helper\Context $context
    ) {
        parent::__construct($context);
        $this->_registry = $registry;
        $this->_resultPageFactory = $resultPageFactory;
        $this->_objectManager = $objectManager;
        $this->_messageManager = $messageManager;
        $this->_scopeConfig = $context->getScopeConfig();
        $this->_storeManager = $storeManager;
        $this->layoutFactory = $layoutFactory;
        $this->_productTypeConfigurable = $catalogProductTypeConfigurable;
    }

    public function renderWishlistCount(\Magento\Catalog\Model\Product $product)
    {
        $html = '';

        $id    = $this->_storeManager->getStore(true)->getId();
        $model = $this->_objectManager->create('Magento\Wishlist\Model\Wishlist');
        $html = $model->getCollection()
            ->addFieldToFilter('store_id', ['like' => "%$id%"])
            ->addFieldToFilter('product_id', ['like' => "%$product->getId()%"])

        return $html;
    }
}


texts: Magento2: Need to get url of system configuration section fields

texts:
I Need to get a URL of system configuration section fields.
Anyone have a solution for this?

Here is my code:

namespace abc\Mkt\Model\System\Message;

use Magento\Framework\Notification\MessageInterface;

/**
* Class abcKeyMessage
*/
class abcKeyMessage implements MessageInterface
{
    protected $_objectManager;
    protected $urlBuilder;
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectmanager,
        \Magento\Framework\UrlInterface $urlBuilder
    )
    {
        $this->_objectManager = $objectmanager;
        $this->urlBuilder = $urlBuilder;
    }

   /**
    * Message identity
    */
   const MESSAGE_IDENTITY = 'mkt_system_message';
   /**
    * Retrieve unique system message identity
    *
    * @return string
    */
   public function getIdentity()
   {
       return self::MESSAGE_IDENTITY;
   }
   /**
    * Check whether the system message should be shown
    *
    * @return bool
    */

   /**
    * Retrieve system message text
    *
    * @return \Magento\Framework\Phrase
    */
   public function getText()
   {
        return __('urlBuilder->getUrl('adminhtml/system_config/edit/section/graz_auth').'>connector is expired.');
   }
   /**
    * Retrieve system message severity
    * Possible default system message types:
    * - MessageInterface::SEVERITY_CRITICAL
    * - MessageInterface::SEVERITY_MAJOR
    * - MessageInterface::SEVERITY_MINOR
    * - MessageInterface::SEVERITY_NOTICE
    *
    * @return int
    */
   public function getSeverity()
   {
       return self::SEVERITY_MAJOR;
   }
}