texts: Custom script results in Call to a member function on null

texts:
I use the following script to update the stock levels of products from a csv. Worked well until recently, where I created a custom observer where I am checking if the product save occurred in the admin product edit page. Now, the script returns the error:

  Fatal error: Call to a member function getFullActionName() on null

Why would this be happening when it should be able to do this?

The Script

 <?php
 define('MAGENTO', realpath(dirname(__DIR__)));
 require_once MAGENTO . '/app/Mage.php';

 umask(0);
 Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
 $count = 0;

 $file = fopen(MAGENTO . '/apiscripts/tstt.csv', 'r');
 while (($line = fgetcsv($file)) !== FALSE) {

 if ($count == 0) {
 foreach ($line as $key=>$value) {
 $cols[$value] = $key;
 }
 }

 $count++;

 if ($count == 1) continue;

 #Convert the lines to cols
 if ($count > 0) {
 foreach($cols as $col=>$value) {
 unset(${$col});
 ${$col} = $line[$value];
 }
 }

 // Check if SKU exists
 $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);

 if ( $product ) {

 $productId = $product->getIdBySku($sku);
 $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
 $stockItemId = $stockItem->getId();
 $stock = array();

 if (!$stockItemId) {
 $stockItem->setData('product_id', $product->getId());
 $stockItem->setData('stock_id', 1);
 } else {
 $stock = $stockItem->getData();
 }

 foreach($cols as $col=>$value) {
 $stock[$col] = $line[$value];
 }

 foreach($stock as $field => $value) {
 $stockItem->setData($field, $value?$value:0);
 }

 $stockItem->save();

 unset($stockItem);
 unset($product);
 echo "<br />Stock updated $sku";
 }
 }
 fclose($file);

?>

Snippet of the observer

$actionInstance = Mage::app()->getFrontController()->getAction()->getFullActionName();
    if ($actionInstance == 'adminhtml_catalog_product_save') {  ...}

The full observer code

    public function saveStockItemAfter($observer)
{
    $actionInstance = Mage::app()->getFrontController()->getAction()->getFullActionName();
    if ($actionInstance == 'adminhtml_catalog_product_save') {
           $stockItem = $observer->getEvent()->getItem();
           $custReason = Mage::app()->getRequest()->getParam('stock_change_reason');

        if (!$stockItem->getStockStatusChangedAutomaticallyFlag() && $stockItem->getOriginalInventoryQty() != $stockItem->getQty()) {
            if (!$message = $stockItem->getSaveMovementMessage()) {
                    if (Mage::getSingleton('api/session')->getSessionId()) {
                        $message = sprintf('Stock saved from Magento API%s', $this->_getStockReason($custReason) ?': '.$this->_getStockReason($custReason):'');
                    } else {
                        $message = sprintf('Manual Save%s', $this->_getStockReason($custReason) ?': '.$this->_getStockReason($custReason):'');
                    }
                }
                $this->insertStockMovement($stockItem, $message);
            }
    }
}

CSV


texts: After login, there isnt log out option in front end

texts:
For some reason after upgrading to 1.9.1 or maybe before

when visitors logging in they can't logout

www.newtech.co.uk

Any help will be appreciated


texts: Magento 2 - Multiline content for static block installer

texts:
What is best practice on Magento 2 for having multiline html in content? On Magento 1 if I remember right you would use some thing <<<'EOT'

I'm getting syntax errors on this:

$cmsBlockData = [
    'title' => "test block",
    'identifier' => "test-block",
    'content' => "

",
    'is_active' => 1,
    'stores' => [0],
    'sort_order' => 0
];


texts:
The theme fallback on CE is

custom-package/custom-theme
custom-package/default
base/default

However in the Enterprise Edition, there is an added enterprise/default package and theme. So does the fallback become

custom-package/custom-theme
custom-package/default
enterprise/default
base/default

??

According to this link

https://www.sonassi.com/blog/magento-kb/magento-enterprise-theme-fallback

it doesn't seem like it was the case at the time of writing, but they mentioned they submitted it to the Magento dev team. I'm wondering if this has been addressed, and if so in which EE version?

In versions where this isn't the case (or if it isn't the case at all), what are we supposed to do when we have custom package and theme? Copy everything over from enterprise/default to our custom-package/custom-theme??


texts:
A Client has mentioned to me a bug which is near impossible to re-produce thus only leaves theory based solutions.

I thought I would check to see if anyone else has stumbled upon this issue and with guidance or a solution.

Site Outline

our client has

60,000 + products
over 40 sites (within single magento build)

When they run a re-index it takes up to 4 hours (yes our import script disabled re-index on save to help speed up the indexing process, this is due to number of products X number of stores)

The Issue:

Approximately 4 times in the past couple of months, ONE of the category pages shows 0 products, for a time of up to 1 day.

It appears re-indexing is still running when this happens.

It is difficult to reproduce (tried several scenarios) but is very important to resolve.

Has anyone else heard of / looked into / resolved this issue in the past?

My Theory:

1: They are viewing the page during the re-index process (re-index empties the SQL table then re-populates it, they happen to catch this as this time)

1a: Index Crashed during this step

1b: FPC has cached this version of the page during this process.

So I ask my friends, any more suggestions would be appreciated here.


texts: What is dependency injection in magento 2

texts:
I am new in Magento 2.

I wanted to know, what is dependency injection in magento 2.

What the concept is about, and how to use it in our framework ?

I have referred this documentation

But still haven't got the concept correctly.


texts: Magento2 : Display message on cart summary page?

texts:
I have set discount cart price rule. But before rule apply print message on cart summary page .
Example:

When order total $400 then display message "Orders over $500 receives 5% off ".
When order total $800 then display message "Orders over $1000 receives 10% off "

Before image

Expected output


texts: Magento 2 import product VAT rate from csv

texts:
I have a product csv file which I would like import into Magento 2. It contains all the required product data including the VAT rate for each product. This is represented as a percentage which can take one of three possible values: 0, 5 or 20.

What needs to be done to allow this value to be applied to each respective product?


texts: showing 404 error Page not found in magento 1 admin panel

texts:
when iam install any type extension and going to this extension setting then face this 404 error.plz give me solution.

i am clean cache and reindex but provlem not solved.


texts: Magento 1.5 CE - need help with shipping rules excluding certain categories from free international shipping

texts: I need help with the shipping rules. Basically - free shipping on everything over $100 excluding any item from category 907, 110 for free international shipping. I need to charge the buyer with shipping if they order a product from the above category. Even if its just a single item from the category.


texts:
I need to add the following custom fonts to my magento 2 theme:
DINNextboldPro
GothamBold
GothamLigh
But I didn't make it, someone can help me please


texts:
I need to add some options to specific products where a user can select multiple (or none) of them. I found this solution: https://magento.stackexchange.com/a/32026/22936

Well, the solution looks okay to me but I need different prices even if the description of the options remains the same. Is there an easy way to achieve this or do I have to create an option for every single price I'll have?

The best thing would be to set the price on the products admin page. Is there any way to do this?


texts: Customer shipping and billing display only one state and hide other states

texts:
I am developing an application where the customer is in Canada and the state Quebec only (no other states of Canada).

I wanted to make the customer choose only Quebec state and always Quebec only.
I googled lot for this to hide other states in the select box or to get only Quebec state. I am not getting where to change the code.

I checked if there's JavaScript code to take the role to display and hide the tabs in checkout. Where do I need to hide the other states or select only the Quebec state Id from database?

How can I restrict the customer to select only one Quebec state, only. Already Canada is the only country in the country selection.


texts: Set the Magento API URL to public address, not custom admin URL

texts:
I have a magento installation where we have public-facing nodes and an internally-routable-only custom url admin node (so, public hits market.example.com and customer service uses admin.example.com/)

When we have plugin vendors calling the API on the public nodes (market.example.com/api/v2_soap?wsdl=true) they get back a service address node describing the custom admin url (admin.example.com)

Is there a way to have the api serve the store url and not the admin url?

Based on this thread (Magento SOAP V1 - Change Soap Address) it seems like it should be reading the url from the config to build the internal state variables, but how can I control which configuration state is used (so the default storefront instead of admin)?

Update - 10/2/15: I filed a case with Magento support and they have let me know that there seems to be a defect in the core causing this. We expect to have a patch issued early next week. I'll create an answer with the details once we have it and confirmed it solves the issue.


texts:
Here is the setup:

Magento 2.4 up and running
Windows 10 & Xampp
Php 7.3.25
Xdebug enabled.Below is php.ini configuration, xdebug section

[XDEBUG]
zend_extension = "C:/xampp/php/ext/php_xdebug.dll"

xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
;36000 = 10h
xdebug.remote_cookie_expire_time = 36000

However when I run the magento - it keeps spinning endlessly.
Any help would be appreciated.


texts: Magento Disabled Products Showing on Google Search

texts:
Magento disabled products are showing in google search results. How can i remove them from google search result?.

When I click them, my website open and show 404 error page. Showing this error for users can be a bad user experience. I am using Magento 1.9.2. I do not want to show disabled products on google search result.

How do I remove these links from Google?


texts: Exposing custom column value in api calls

texts:
I am building a module that needs to display a second custom price value at all times. I have solved most of what this entails but got stuck with the quite item.

So far i added a column in the quote item table called something like "my_special_price".

I also added the extension attributes to the TotalsItemInterface:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Quote\Api\Data\TotalsItemInterface">
        <attribute code="my_special_price" type="float"></attribute>
    </extension_attributes>
</config>

I then proceded to set the value using a plugin:

    $this->totalsItemExtensionInterface->setMySpecialPrice($item->getData('my_special_price'));

    $result->setData('my_special_price', $item->getData('my_special_price'));
    $result->setExtensionAttributes($this->totalsItemExtensionInterface);

    return $result;

I do this with a around on modelToDataObject which is in the class Magento\Quote\Model\Cart\Totals\ItemConverter.

I also created a class that implements "TotalsItemExtensionInterface" where setMySpecialPrice etc is implemented because of the interface.

Then, when I instantiate \Magento\Checkout\Api\Data\PaymentDetailsInterface and set all the details for that interface(totals, etc) it shows up under:

  items[0][_data][extension_attributes(My TotalsItemExtension
  class)[_data][my_special_price] = 123

I then proceed to return that PaymentDetailsInterface through the API. But the value is not included in the response.

I am obviously doing something wrong here, but what? Some input would be greatly appreciated.


texts: Payment method displaying twice in front end

texts:
I'm trying to swap from an old version of Realex payments module developed by SF9 to a new one built by Yoma. Both of these modules use the same resource name and the same table names so to get the new plugin to install I've removed the resource from core_resources and dropped the tables.

I've managed to do some test payments successfully however there seems to be one small issue with the module, the payment option displays twice in the checkout. this seems limited to just this modules payment options as the default magento options I've tested only display once.

The html output for these is also identical so it seems like a accidental dump of the same item twice. so while i could hide one with JS or CSS I'm trying to avoid this option for now.

Unfortunately there is seems to be no support for this module from what I can find, so I'm left trying to debug it by myself.

I've gone through the code and tried to debug the issue myself however I'm working blind when it comes to adding a new payment option. What would be a good string to search for, or a config option I need to look for that would be prudent to look for to find a duplicated payment option?

Edit:

I have now installed a fresh Magento installation and just the module with the same settings and it doesn't display twice.

So I turned off every non standard Magento module and set the theme to default on my staging site, but my staging site is still showing the payment option twice. So i assume this must be something to do with the database.


texts:
My data is in this format. I want it without wishlist_id, means simple values. How to change the array values?

Array (
    [0] => Array ( [wishlist_id] => 35 )
    [1] => Array ( [wishlist_id] => 36 )
    [2] => Array ( [wishlist_id] => 38 )
    [3] => Array ( [wishlist_id] => 39 )
    [4] => Array ( [wishlist_id] => 42 )
    [5] => Array ( [wishlist_id] => 43 )
    [6] => Array ( [wishlist_id] => 45 )
    [7] => Array ( [wishlist_id] => 48 )
    [8] => Array ( [wishlist_id] => 50 )
    [9] => Array ( [wishlist_id] => 52 )
    [10] => Array ( [wishlist_id] => 53 )
    [11] => Array ( [wishlist_id] => 55 )
    [12] => Array ( [wishlist_id] => 57 )
    [13] => Array ( [wishlist_id] => 59 )
    [14] => Array ( [wishlist_id] => 60 )
    [15] => Array ( [wishlist_id] => 63 )
    [16] => Array ( [wishlist_id] => 66 )
    [17] => Array ( [wishlist_id] => 67 )
    [18] => Array ( [wishlist_id] => 69 )
    [19] => Array ( [wishlist_id] => 70 )
    [20] => Array ( [wishlist_id] => 73 )
    [21] => Array ( [wishlist_id] => 75 )
    [22] => Array ( [wishlist_id] => 76 )
    [23] => Array ( [wishlist_id] => 78 )
    [24] => Array ( [wishlist_id] => 80 )
    [25] => Array ( [wishlist_id] => 83 )
    [26] => Array ( [wishlist_id] => 85 )
)


texts: Do I need a special ODBC driver to connect Fedex Shipping Manager with a remotely hosted Magento database from Windows 7?

texts:
Trying to get my Fedex Ship Manager software connected to the remotely hosted magento database. I successfully connected the software to a zencart based database with the ODBC 3.51 Driver from mysql, but this driver does not get me connected with the magento database.
I searched on google for information on Magento ODBC drivers and all I can find are companies selling them, not any information regarding if I actually need a special one or not. Trying to rule out if this is the cause or not. Nexcess tech support is not helpful, using all of the connection settings they told me to and still unable to connect


texts: Setting up Magento Cloud local development environment - Docker

texts:
I'm having issues when it comes to setting up a docker development environment for Magento Commerce Cloud.

I followed steps described here:

https://devdocs.magento.com/guides/v2.2/cloud/setup/first-time-setup.html
https://devdocs.magento.com/guides/v2.2/cloud/docker/docker-development.html
https://devdocs.magento.com/guides/v2.2/cloud/docker/docker-config.html
https://github.com/magento/magento-cloud

and I got up and running latest, empty Magento Commerce (Cloud) 2.2.6.
Nothing out of the ordinary.

Then I tried to repeat those steps to create working environment for the project (2.2.2) I'm currently working on.
I cloned the project using magento-cloud get ************* -e development and copied docker-compose.yml file and docker directory from the clean template directory to project directory.

I expected everything would work the same, but a bunch of errors popped up.

Errors

#1  Command: docker-compose run build cloud-build
#1  Result:
[Magento\MagentoCloud\Filesystem\FileSystemException]
The directory "/var/www/magento/var" cannot be deleted Warning!rmdir(/var/www/magento/var): Device or resource busy

After giving sudo to command above the error was slightly different

#2  Command: sudo docker-compose run build cloud-build
#2  Result:
[RuntimeException]
Command git apply /var/www/magento/vendor/magento/ece-tools/patches/locker-process.patch returned code 1

How do I get over these errors? Is there something crucial I'm missing here? Could it be that there is an issue inside the actual project code?

Thanks in advance


texts: Magento products depending on country of delivery

texts:
I'm just starting exploring Magento, to update our current site.
One of the requirements is that the displayed catalog, is depending on the country of delivery. Not all products can be shipped to specific countries.

On our current site's homepage, we have a popup asking the country of delivery. That way we know the correct productlist to display.

How is this done in Magento?


texts:
I have my Magento 2 shop at domain.local/shop/ address. I have Croatian (HR) store view by default and also English (en), Deutsch (de) store views.

The problem is that when I open domain.local/shop/en/ or domain.local/shop/de/ (I have store codes enabled for urls), I get the Croatian language though language switcher shows EN or DE. Only when I manually switch to HR and then back to EN or DE, I finally get the appropriate store view.

Why doesn't language switching work by URL?


texts: Magento 2 No such entity with cartid = help!

texts:
I'm experiencing this error on my site quite often:

  Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with cartId =

It's not using multiple stores, so the entity_ids are not an issue as stated in many other solutions I have tried.

Need this error fixed, can't find anything helpful anywhere else.


texts: How to add 'Total Orders' Count column to Order Grid

texts:
Brief

Add a column to the Order Grid, entitled "Total Orders" that shows the total count of orders for each customer.

Problem

I've taken what I've understood from here. This has successfully managed to create the desired column but without any results. I believe the error lies somewhere within part 2 of my implementation.

Where I'm at

1 - Override created /app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php

2 - Added below to _prepareCollection()

$alias = 'subselect';
$subselect = Mage::getModel('Varien_Db_Select',
    Mage::getSingleton('core/resource')->getConnection('core_read')
    )->from('sales_flat_order_grid', array(
            'customer_id as s_customer_id',
            'count(*) as total_orders')
    )->group('customer_id');

$collection->getSelect()
    ->joinInner(array($alias => $subselect),
        "{$alias}.s_customer_id = main_table.customer_id");

3 - Added below to _prepareColumns()

$this->addColumn('total_orders', array(
    'header' => Mage::helper('sales')->__('Total Orders'),
    'index' => 'total_orders',
    'filter_index' => 'total_orders',
));


texts:
How can i disable special price in everywhere. but without use css, is it possible ?
please have a look attached image, thanks in advance


texts: Change currency symbol position from left to right in RTL theme

texts:
I have tried to change currency position using below mentioned observer code its working on English website that list LTR but its not working on Arabic website that is RTL.
app/code/Vendor/Moduele/etc/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="currency_display_options_forming">
        <observer name="vendor_module_change_currency_position" instance="Vendor\Module\Observer\Changecurrencyposition" />
    </event>
</config>

app/code/Vendor/Module/Observer/Changecurrencyposition.php
<?php
namespace Vendor\Module\Observer;

use Magento\Framework\Event\ObserverInterface;

class Changecurrencyposition implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $currencyOptions = $observer->getEvent()->getCurrencyOptions();
        $currencyOptions->setData('position', \Magento\Framework\Currency::LEFT);
        return $this;
    }
}

What i observed is there is tag &rlm; coming between currency symbol and amount AED&rlm;10.00 and when i removing this &rlm; tag by inspect element it working but its not working by code. Your help is highly appreciated thank you in advance.


texts: How to force update/refresh shipping methods on checkout Magento 2 after put the cep

texts:
i need to force update/refresh shipping methods,  but now it only dont reload the pag after  in checkout that i put the zip-code
if explain, please write what past that i need to put line or fill blank


texts: Magento 2 times used of cart price rules are wrong

texts:
I have configured a cart price rule without coupon with uses per customer as 4. The customer gets discount for his 3 orders. But he didn't get the discount for 4th order. But the "times_used" field in the "salesrule_customer" is updated as 4. This issue exist only for few customers. This issue is exist with coupon and without coupon.
How do I fix this?


texts:
In my cart page i am trying to alter the styles of total price displayed

frontend\base\default\template\checkout/cart/totals.phtml

frontend\base\default\template\tax/checkout/grandtotal.phtml

frontend\base\default\template\tax/checkout/subtotal.phtml

These templates displays the subtotal and grand total.

<tfoot>
            <?php echo $this->renderTotals('footer'); ?>
        </tfoot>
        <tbody>
            <?php echo $this->renderTotals(); ?>
        </tbody>

This is the default phtml. The <tfoot> appears on first followed by <tbody> but in browser the <tfoot> appears after <tbody> .

I was trying to modify the htmls for displaying this, but the pbm i facing is grand total appears above sub total.

How to make grand total appear after sub total?


texts:
How to call custom block file in custom theme in magento 2

  app/code/Cm/Mod/view/frontend/layout/catalog_product_view.xml

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

      <referenceContainer name="product.info.main">
        <block class="Cm\Mod\Block\Display"
               name="product.view.extra"
               template="Cm_Mod::product/view/extra.phtml"
              after="product.info.overview">
        </block>
    </referenceContainer>

</page>

  app/code/Cm/Mod/view/frontend/templates/product/view/extra.phtml

custom block

How to call a extra.phtml file in custom theme in magento 2
someone please help me


texts: Create an attribute for a category in Magento programmatically

texts: How to create an attribute Magento category programmatically?


texts: How to move Apply coupon code button on product page

texts: Is it possible to move apply coupon code button on product page and it will work or not ?


texts: Adding future date/time to TrustPilot script in Magento Packing Slip

texts:
I am about to add a "Structured Data Snippet" to my Magento packing slip emails, which should include a future date.

The snippet looks like this (example data):

<script type="application/json+trustpilot">
{
  "recipientName": "Name MacNameson",
  "recipientEmail": "customer@email.com",
  "referenceId": "1234abcd",
  "preferredSendTime": "2016-02-29T13:37:00"
}
</script>

...and the preferredSendTime should be set to 7 days from now. Time could be 18:00 on them all..

So for instance; if the packing slip is created 2018-03-14 in the morning some time, the value should show "2018-03-21T18:00:00" (which is 18:00 the evening 7 days later)

How can I achieve this? Any help appreciated.


texts: order details in observer not working - magento 2

texts:
I am trying to get order details in observer (event: checkout_submit_all_after). I am trying to print the order details in debug.log, but nothing printed.

Please refer this know about my complete module structure. I could change observer class functionality like below for getting order details.

app/code/Gworks/Sms/Observer/LogAddMessage.php

<?php
namespace Gworks\Sms\Observer;
use Magento\Framework\Event\ObserverInterface;
class LogAddMessage implements ObserverInterface
{
    protected $_logger;
    public function __construct(
    \Psr\Log\LoggerInterface $logger, //log injection
    array $data = []
    ) {
    $this->_logger = $logger;
       // parent::__construct($data);
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
       $this->_logger->addDebug('getplace oreder event occured successfully!');
    }

    public function getOrder(\Magento\Framework\Event\Observer $observer)
    {
    $order = $observer->getEvent()->getOrder();
    $order_id = $order->getIncrementId();
    $this->logger->addDebug($order_id);
    }
}

debug.log

[2016-04-26 10:14:10] main.DEBUG: getplace oreder event occured successfully! {"is_exception":false} []
[2016-04-26 10:14:10] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://magentodev.gworks.mobi/magento2/rest/default/V1/carts/mine/payment-information","invalidateInfo":{"tags":["catalog_category_2","catalog_category_26","catalog_category_30","catalog_category_34","catalog_category"],"mode":"matchingAnyTag"},"is_exception":false} []

when define order details in execute method it will throw the below error while place order

[2016-04-26 11:37:42] main.CRITICAL: exception 'Exception' with message 'Report ID: webapi-571f53065307a; Message: Notice: Array to string conversion in /var/www/html/magento2/vendor/monolog/monolog/src/Monolog/Logger.php on line 277' in /var/www/html/magento2/vendor/magento/framework/Webapi/ErrorProcessor.php:194
Stack trace:
#0 /var/www/html/magento2/vendor/magento/framework/Webapi/ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(Exception))
#1 /var/www/html/magento2/vendor/magento/module-webapi/Controller/Rest.php(163): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(Exception))
#2 /var/www/html/magento2/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#3 /var/www/html/magento2/vendor/magento/framework/App/Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#4 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#5 /var/www/html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#6 {main} [] []

complete module in Github

Thanks


texts: How to update product name for main website and all store

texts:
I am updating the product name and it only affects the En store view I want to update product name for all store views and main website as well. see the sample code below

   $sku = 'E20630';
    $product = $this->getProductBySku($sku);
    if ($product) {
        $product->setName('New Name');
        $this->productRepository->save($product);
        $response = ['success' => 'ok', 'message' => 'product updated'];
        header('Content-Type: application/json');
        echo json_encode($response); exit;
    }

For En store product name is changed

For All Store Views, product name is not changed


texts:
Improve Search Result Speed
How to improve search result speed?


texts: Magento change product attribute scope STORE to GLOBAL

texts:
I added "test_att" attribute having scope is STORE VIEW. Now I want to change attribute scope to GLOBAL.

How I will achieve this updation?


texts: Magento 2: How to update checkout sidebar when choose shipping radio button?

texts:
How to show Total section in sidebar inside shipping step of onepage checkout page when click on shipping radio button in magento 2.

By default Total section dispaly, in payment step with subtotal,tax,discount and shipping info.

I want to display total block inside shipping step when click on shipping radio button.


texts:
I have modified Magento_Catalog/templates/product/list.phtml. I added this code:
/** @var $pagerBlock Magento\Theme\Block\Html\Pager */
$pagerBlock = $this->getLayout()->createBlock("Magento\Theme\Block\Html\Pager");
$pagerBlock->setCollection($_productCollection);

Which gives me the pager block for the catalog page I'm on. Which seemed to work.
The method getNextPageUrl returns the correct page.
However, in a catalog of only 2 pages everything goes wrong. On page 1 and 2 (which is the last page) of my catalog the pager block returns true for all of these three methods:
$pagerBlock->isLastPage();
$pagerBlock->getLastPageNum();
$pagerBlock->getCurrentPage();

getNextPageUrl returns page one (https://domain.loc/en/singleplayer/preschool-games.html?p=1)
What's going on?


texts:
I'm starting my first foray into developing a theme for Magento 2 and currently it's not listing my theme when I go to Stores > General > Design, only Luma and Blank.

I have set up the theme with the directory structure as outlined here and added an entry for the theme in dev/tools/grunt/configs/registration.php

Does anyone have any advice?


texts: Automate "Get Payment Update" with Magento and Athourize.net

texts:
Here is our current process with Magento and Authorize.net and I would like to see if it is possible to automate the "Get Payment Update" sequence.

Current Process:
-Customer submitted orders and orders are set to "Payment Review" and Authorize.net sends an email alert
-Login into Authorize.net and review transactions and approve the new orders
-Login into Magento portal and click on "Get Update Payment"on individual orders. Each order are set to "Processing" status.

Proposal Process:
-Customer submitted orders and orders are set to "Payment Review" and Authorize.net sends an email alert
-Login into Authorize.net and review transactions and approve the new orders
-Automate a process within Magento to "Get Update Payment" if an order is in "Payment Review" status.

Our current process helps us with the fraud orders and would like to remain the same.  I would like to automate or schedule a job to run if an order is in "Payment Review" status check with Authorize.net.  If that order is approved, set the status to "Processing".

Thanks,

Von


texts:
There is an issue with the current patch (SUPEE-6788) for Magento 1.8.1.0.

When I try to apply the patch I get the error of:

patching file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
Hunk #1 FAILED at 131.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php.rej

When I pulled down a clean version of 1.8.1.0 and did a diff, there was no difference.

I then looked into the patch file and saw it was expecting another function below line 131.

I found that function is in later versions (1.9.2.0+).

I just added that function to the app/code/core/Mage/Core/Controller/Varien/Router/Admin.php file, and re-ran the patch and everything worked.

Is that an okay work-around? That function will never be called but I am not sure if this will cause issues later on (like future patches).

EDIT

According to my applied.patches.list file I applied the following patches: SUPEE-5344, SUPEE-1533, SUPEE-5994, SUPEE-6285, and SUPEE-6482


texts:
I have this code in a custom observer to check current products in quote for stockstatusses etc. But this code adds like 4 to 6 seconds to loading the checkout. I guess the way the data is retrieved is far from ideal, but I'm not sure how to fix it. Can anybody give advice to make this more lean?

    $quote = Mage::getModel('checkout/session')->getQuote();
    $cartItems = $quote->getAllItems();

    foreach ($cartItems as $item) {
        $product = Mage::getModel('catalog/product')->load($item->getProductId());
        $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
        [...]
    }

Update:
Thanks to your input the current code is getting along, but I have one snag I can't seem to figure out. The goal of this observer is to check whatever is in the cart, and check a few things, to alter the checkout process accordingly. The things it checks:

Quantity of stock
Weight
A custom boolean for alternative stock

The code is now:

$cartItems = Mage::getSingleton('checkout/cart')->getQuote()->getAllVisibleItems();

foreach ($cartItems as $item) {
    $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($item->getProductId)->getQty();
    if ($stock < 1) { ... }
    if ($item->getCustomStock()) { ... }
    if ($item->getWeight() >= 30) { ... }
}

I still couldn't (figure out) to write this as a collection as in the suggested documentation, because I couldn't get the current cart contents to behave as a collection. Even so, the loading done in the loop now only gets the stock info of the selected product, so it is already way more efficient.
The thing that I'm stuck at is the getCustomStock bit; it's a custom attribute boolean named custom_stock, but I guess this attribute isn't collected here. How would I add it / any other advice on this approach?


texts:
I want to change product inventory from in stock to out of stock at once. how will do?
Bcoz, one by one takes lot of time, want to save time.


texts:
My URLs for categories keep adding numbers at the end of the URL in this format:

/solid-oak-beds-13.html

It is getting increasingly hard to keep track of links, since the urls are not getting created with the URL key I provide.

Is there a simple solution to this? I have tried to reindex, but this simple increases the number.


texts:
I need to open a popup on click of anchor link. I followed this (How to open popup when <a> tag onClick?) answer but the issue is that i have to add script inside .phtml file.

I want to include the script in .js file and then use it. How can i achieve this?

I have already tried by adding inside Vendor/Theme/web/js/custom.js but then the pop up is not getting displayed.

The second solution in the (How to open popup when <a> tag onClick?) link is not working for me.

Can some guide me towards this?


texts: Can virtual types be used as source models for EAV attributes?

texts:
I'm creating my own EAV entity and one of the attributes of my entity has the type select so it requires a source model.
But I don't want to create my own class just for this attribute since I already have a virtual type defined for it that I use in the form and grid for a flat entity in the same module.

<virtualType name="SomeTypeNameHere" type="[Namespace]\[Module]\Model\Source\Options">
    <arguments>
        <argument name="options" xsi:type="array">
            <item name="1" xsi:type="array">
                <item name="value" xsi:type="number">1</item>
                <item name="label" xsi:type="string" translate="true">Label 1</item>
            </item>
            <item name="2" xsi:type="array">
                <item name="value" xsi:type="number">2</item>
                <item name="label" xsi:type="string" translate="true">Label 2</item>
            </item>
        </argument>
    </arguments>
</virtualType>

Can I use SomeTypeNameHere as a source_model for an attribute ?
I know I can test this, but I'm far from having a functional entity. I'm still in the setup phase (more or less).
If someone already tried this I could use a simple Yes/No answer so I know which direction to take.


texts: Order status is not changing to processing even if successful online transaction

texts:
I am using CCAvenue Payment Gateway which is developed by BlueZeal. Sometimes the order status not changing to Processing keep shown Pending. I asked both teams they replied me, pls check with Magento Team.

May I know what are all possibilities for order status keep shown Pending even if successful Paid.

  Note: Not for every order,  two or three per month.


texts: CustomerAddresses is not defined -- editing customer addresses

texts:
When editing the customer addresses in the backend of my magento installation, it gives me this JS error. I can't click the edit,delete or add button in the addresses page. I have checked the addresses.php file, but can't find the location of where customerAddresses is set. Is it a case of a missing library script?

(P.s. This is my first time working/troubleshooting Magento, i have been programming for a while though.)


texts:
I'm trying to override a method within Mage/CatalogSearch/Block/Autocomplete.php (to display a maximum of 5 results for the search autocomplete)

Now I just want to make sure I'm doing this correctly. I have defined my class in this block's config.xml:

<config>
    <global>
        <blocks>
            <tag>
                <rewrite>
                    <product_list>Test_CatalogSearch_Block_Autocomplete</product_list>
                </rewrite>
            </tag>
        </blocks>
    </global>
</config>

My question about this part is:

Do I specify everything within the <blocks> node within the config file's <blocks> node? or do I use the above structure separately? I assume the former but want to make sure.

Once I complete the above, I assume I just need to create the class (within the local codepool), extend it and then override the method I have in mind? Something like this:

class Test_CatalogSearch_Block_Autocomplete extends Mage_CatalogSearch_Block_Autocomplete {

    public function getSuggestData() {
    if (!$this->_suggestData) {
        # The line I'm overriding ..
        $collection = $this->helper('catalogsearch')->getSuggestCollection()->setPageSize(5);;
        $query = $this->helper('catalogsearch')->getQueryText();
        $counter = 0;
        $data = array();
        foreach ($collection as $item) {
            $_data = array(
                'title' => $item->getQueryText(),
                'row_class' => (++$counter)%2?'odd':'even',
                'num_of_results' => $item->getNumResults()
            );

            if ($item->getQueryText() == $query) {
                array_unshift($data, $_data);
            }
            else {
                $data[] = $_data;
            }
        }
        $this->_suggestData = $data;
        }
    return $this->_suggestData;
    }
}

I'm new to Magento and just want to make sure I'm on the right tracks. Any help would be great.

Thanks!


texts: Magento 2 : Add to Wishlist not Appearing on Product Page

texts:
When the store is using custom child theme design, add to wishlist is not appearing on the product page.

When I switch to other theme, it appears.

What could be the reason?

UPDATE:

I realised that when I have catalog_product_view.xml under my custom theme in Magento_Catalog/layout, add to wishlist is not appearing.


texts: Magento - Shipping & VAT for Zero Rated & 20% Products

texts:
I am getting a little lost in the complexity of TAX settings and shipping.

Issue: I sell both 0% and 20% VAT applicable products.  When I sell a 0% product, then shipping is to be set at 0% VAT.  When I sell a 20% product shipping is to be set at 20% VAT.  When I have a mix of 0% & 20%, shipping should be set to 20%.

This is what I have tried to date:

Set shipping Tax Rate:

Config > Sales > Tax > Tax Class for Shipping > SHIPPING

On its own this does not apply/show any VAT at checkout for shipping.

Sales > Tax > Tax Rules - - I have added SHIPPING to both Zero Rated and 20% VAT rules
RESULT:  This adds VAT to shipping when only a 0% product is in basket

Sales > Tax > Tax Rules  I have added SHIPPING to 20% VAT rule only
RESULT:  This adds VAT to shipping when only a 0% product is in basket

Sales > Tax > Tax Rules  I have added SHIPPING to Zero Rated VAT rule only
RESULT:  This does not add VAT to shipping when 20% product is in basket.

Can someone help me out with a solution.  thanks


texts: Form admin difference between formFactory and XML

texts:
I'm new in Magento 2 and I couldn't figure out what is the difference in doing a admin form module in PHP, calling a class and then using formFactory to create the form:

<referenceContainer name="content">
            <block class="BVZ\Designer\Block\Adminhtml\Post\Edit" name="designer_post_edit"/>
</referenceContainer>

[...]

$form = $this->_formFactory->create(
            [
                'data' => [
                    'id' => 'edit_form',
                    'action' => $this->getData('action'),
                    'method' => 'post',
                    'enctype' => 'multipart/form-data'
                ]
            ]

or calling a Ui component and using a xml fieldset

<body>
        <referenceContainer name="content">
            <uiComponent name="stores_index_edit"/>
        </referenceContainer>
</body>

[...]

<field name="store_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">false</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">store</item>
                </item>
            </argument>
</field>

Is it a method better than the other or it has different proposals?


texts:
After install magento 2.3.5-p1 i got exception on setup page (in web setup).

PHP Fatal error:  Uncaught Zend_Cache_Exception: cache_dir "/var/www/html/magento2/var/page_cache" is not writable in /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php:209\nStack trace:\n#0 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/var...')\n#1 /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php(87): Zend_Cache_Backend_File->setCacheDir('/var/www/html/m...')\n#2 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array)\n#3 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)\n#4 /var/www/html/magento2/vendor/magento/framework/App/Cache/Frontend/Factory.php(156): Zend_Cache::factory('Magento\\\\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, true, true)\n#5 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Adapter/Zend.ph in /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php on line 209

But I set permissions like in Magento documentation.
Only help to set 777 to var/  generated/ app/ and pub/
but it's not right way. Because after all this Magento install correct but when I try to run setup:upgrade afterwards, I lose my permissions and get the same error again.


texts: Magento is taking frontend\base\default\template\page/2columns-right.phtm path instead of frontend\default\new_design\template

texts:
Recently I have applied one extension in my project. In view page CSS is not getting reflected since it takes path of base/default. But actual path is in default/new_design.

How to call default/new_design path?


texts:
After firing this command in CLI php bin/magento setup:upgrade

I am getting below error -:

Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory
/var/www/html/magento/magento2.0/var/generation/Magento/Framework/App/ResourceConnection/.' in
/var/www/html/magento/magento2.0/vendor/magento/framework/Code/Generator.php:103
Stack trace:
#0 /var/www/html/magento/magento2.0/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...')
#1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...') #2 [internal function]: spl_autoload_call('Magento\\Framewo...')
#3 /var/www/html/magento/magento2.0/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...')
#4 /var/www/html/magento/magento2.0/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...')
#5 /var/www/html/magento/magento2.0/vendor/magento/framework/ObjectMana in /var/www/html/magento/magento2.0/vendor/magento/framework/Code/Generator.php on line 103`


texts: Magento 2.2.6 quick search is not working for sometimes

texts:
I am trying to search a product through a quick search using the product name and its brand name.

But it does not work for all product. Only for some product.

E.g if I search products of brand "XYZ" then it shows the result. But when I search products of brand "ABC" it shows me a message "Your search returned no results."

I have checked at Marketing >> SEO & Search >> Search terms

So it shows the result count 0 for that particular term.

Am I missing anything here?


texts: How to access the product in a observer for layout_load_before for PDP page

texts:
I'm trying to access one of the attributes of the product in the observer for layout_load_before. But I'm getting an empty results.
frontend/events.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
    <event name="layout_load_before">
        <observer name="pdp_pageload_observer" instance="ABC\Custom\Observer\UpdateLayout" />
    </event>
</config>

I tried various ways to get the product detail in the observer.

$observer->getProuduct();

Using session

$productId = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Catalog\Model\Session')->getData('last_viewed_product_id');
            $logger->info('$productId from sesssion'.json_encode($productId));

Using register

$product = $this->_registry->registry('current_product');

None of these helped me. Could you pls let me know how to get the product details and why the above methods are not working


texts: Account Information Link in Customer Dashboard is not working - Magento 2.4

texts: Account Information Link is not working in customer dashboard, when i click on this link then getting below error.


texts: Invalid foreach supply while getting catg collection in dropdown

texts:
Am getting invalid foreach supply while getting catg collection in phtml file. i am trying to show the catg collection in dropdown store-wise
<div class="custom-dropdown">
    <select id="parent-cat" name="parent-cat" onchange="getChildrenList(this.value)">
        <?php $categories = $block->getStoreCategories();
        foreach ($categories as $category) {
            echo '<option value="'.$category->getId().'">'.$category->getName().'</option>';
        }
        ?>
    </select>
</div>


texts: hook into magento's output to the client

texts:
I'm quite new to Magento, and i'm looking into the following, wondering if it's possible.

at some point magento will need to do some echo'ing to the client, ie. stream it's html data to the client. At what point does this happen?
Along its execution, or is the output gathered and sent at the end?

I'm looking into a way of inspecting/modifying the html of a page in a generic way, so not from inside a template or something.

Is this possible?


texts:
I see a lot of occurences of this comment /* @escapeNotVerified */ in the template files for Magento2.
Does it have a special meaning?
Is there any use for this?

Examples:

https://github.com/magento/magento2/blob/2.1/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml#L23
https://github.com/magento/magento2/blob/2.1/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml#L10
https://github.com/magento/magento2/blob/2.1/app/code/Magento/Catalog/view/frontend/templates/product/gallery.phtml#L12
I could go on for a few pages here.


texts: Programmatically adding product to cart returns empty cart

texts:
I'm trying to add a product to cart programmatically in magento 1.9.3.3. The code adds database entries (created rows in sales_flat_quote_item and sales_flat_quote tables). But the cart shows as empty.

Here is my code

$cart = Mage::getSingleton('checkout/session')->getQuote();
$product = Mage::getModel('catalog/product')->load(1);
$cart->addProduct($product,1);
$cart->save();
Mage::getSingleton('customer/session')->setCartWasUpdated(true);
Mage::getSingleton('core/session')->addSuccess('The product has been added to cart');
$this->_redirect('checkout/cart');


texts: Product custom options adding radio button slects only one button in magento2

texts:
I have added the radio button for the product custom options, But My requirement is selects only one Radio button in magento2

please find the screen shot:


texts:
I'm working with the email templates from system -> transactional emails. There is a call here that i don't understand.

  {{customVar code=PaymentInfoBox}}

Can someone explain what actually happens here?
I imagine it just tells it where to look for the payment information but this doesn't look like it could be a conrtoller/method path.


texts: How to create 1 order to allow multiple choices of 1 product with varied quantity?

texts:
I have a requirement where -- I would like people to be able to order 1 product + its multiple variations in varied quantity. This can be termed as Bulk Order or Grouped Order -- but below is a table what I am looking forward to use.

User should be able to fill in the [quantity] field & then add to cart.

Any thoughts (or any Addons) would be great


texts: Why does data-migration tool say "core_config_data" document doesn't exist?

texts:
This is what it reads but I do not understand why.

  [2016-10-10 17:40:20][INFO][mode: settings][stage: integrity
  check][step: Settings Step]: started

  100% [============================] Remaining Time: 1 sec

  [2016-10-10 17:40:20][ERROR]: Integrity check failed due to
  "core_config_data" document does not exist in the source resource
  [2016-10-10 17:40:20][INFO][mode: settings][stage: integrity
  check][step: Stores Step]: started

  100% [============================] Remaining Time: 1 sec

  [Migration\Exception] Integrity Check failed   migrate:settings
  [-r|--reset] config


texts:
My Magento site is running on a VPS with
Server version: Apache/2.4.23 (Unix)
PHP Version => 5.5.38

The following optimization in place:
Merge JS/CSS
Magento compilation
Redis Server
Opcache
lesti FPC
Mod_Pagespeed

My site is quick enough https://gtmetrix.com/reports/www.modmybike.in/fdHza8gN but my ttfb is quite high and I want to reduce the TTFB. I am ready to sacrifice the under 2 sec page load speed for quicker connection and TTFB.

I believe the TTFB is high due to Gzip compression.

I have tried to remove the Apache Gzip compression by trying the following methods.

Removed the text/html mime type from AddOutputFilterByType DEFLATE in .htaccess
SetEnvIf Request_URI "(/)" no-gzip dont-vary in .htaccess
Disabled mod_deflate entirely in .htaccess
Moved from using .htaccess to httpd.conf and explicitly set "SetEnv no-gzip 1"
Removed compress in Lesti::FPC
Compression not enabled in Mod_Pagespeed.

Even with all the above attempts the Accept Encoding is still set to 'gzip, deflate'. I have been on this from last 2 weeks without any progress.

My only option i can think of is to rebuild Apache without mod_deflate.

Edit : Commented out #LoadModule mod_deflate in httpd.conf.

httpd -M still lists mod_defalte as a loaded module after restart.

Please help.


texts: Customer Account - Not saving after backend edits

texts:
Whenever we try to make an edit to a customer record (in the backend), it will not allow us to save.
The 'Please Wait...' loading image appears in the middle of the screen and stays there to no end.

When I refresh and log back in (after timeout) the changes are not there.


texts: apply shopping cart price rule programatically

texts:
i have created three rule on customer group.

  25% off
  35% off
  45% off

I want to do some calculation and apply one rule. Can any give me idea about that?

Note: cannot use coupon code.


texts:
We are now developed a Magento store. When I open the index page and then go to the menu of Chrome and then display dev tools of chrome, I have an error Uncaught ReferenceError: Mage is not defined index:39 and the index is variable according to the page displayed with the links of the website.
Anyone can help me with that matter?


texts: Page builder extend. Disable input if Link URL isn't filled in

texts:
I'm extending a few page builder components. I need to disable the new inputs until the link url inside of Content has a value

I can easily disable an input by using the value from another checkbox/select/input but the Link URL works different
This is what I have tried in the pagebuilder_banner_form.xml
<field name="test_input" sortOrder="96" formElement="checkbox">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="default" xsi:type="string">true</item>
                <item name="disabledValues" xsi:type="array">
                    <item name="none" xsi:type="string"></item>
                </item>
            </item>
        </argument>
        <settings>
            <dataType>boolean</dataType>
            <label translate="true">Test Input</label>
            <dataScope>test_input</dataScope>
            <imports>
                <link name="setDisabled">ns = ${ $.ns }, index = link_url:value</link>
            </imports>
        </settings>
        <formElements>
            <checkbox>
                <settings>
                    <valueMap>
                        <map name="true" xsi:type="string">true</map>
                    </valueMap>
                    <prefer>toggle</prefer>
                </settings>
            </checkbox>
        </formElements>
    </field>

I also tried <link name="setDisabled">ns = ${ $.ns }, index = link_url:value.default</link> which kinda works when I open the banner setting the first time but after I save it doesn't work any more.


texts:
I'm having trouble fixing the onepage checkout system. The checkout page buttons don't let you go to the next step, I'm assuming this is the javascript?

In the console it is displaying a few errors but mainly this one:

Uncaught TypeError: Validation is not a constructor
    at d.save (opcheckout.js:353)
    at HTMLButtonElement.onclick ((index):565)


texts:
Fatal error: Uncaught Error: Call to a member function setStockStatus() on boolean in
/home/beerenss/magento2/app/code/MW/Pos/Plugin/Magento/CatalogInventory/Model/StockRegistryProvider.php on line 67.

I disabled all the modules.

'Magento_Inventory' => 0,

to

'Magento_InventorySourceSelectionApi' => 0,


texts: is it ok magento have shell_exec() - magento 2

texts:
My extension needs to run some docker commands from the ajax controller so I use PHP shell_exec() function.

is it ok Magento have shell_exec()?

I'm looking the advice related to Magento security, whether it creates any security vulnerability or not.


texts: Unable to change in stock text for products in Magento

texts:
This is quite a weird one...
At some point previously, we had changed the default 'In Stock' text to 'Available to order' on products in Magento.

Default:-
    Availability: In Stock

New:-
    Availability: Available to order

The thing is, we can't find where or how this is being overridden...

In the below file, the default stock messages In Stock and Out of Stock still remain. If I display template hints with block names on the front end, the block points to this file. If I change the text 'In Stock' in this file, it does change the text 'Available to order' on the front end.

/app/design/frontend/*/default/template/catalog/product/view/type/default.phtml

There are no CSS / JS text replaces for this and there are no language files edited to change the text 'In Stock' to 'Available to order'.

In fact, I have done a site search on the entire contents of the /app directory on the server and there is no results found for 'Available to order' in any file.

All cache has been cleared (including cache storage), and full reindex has been performed.

All I'm trying to achieve, is to change it back to 'In Stock' from 'Available to order' but as per the template file, it is already set to 'In Stock'.

Fast running out of ideas on this one...


texts: Magento 2: Rest API "Checkout Cart Product Add After" event is not working

texts:
I have faced issue in checkout_cart_product_add_after event using add to cart rest API.

Same add to cart event is working in website. But it is not working in Add to cart rest API.

Add to cart API URL: http://magento2/rest/V1/carts/mine/items

Method: POST

Below is my event file path:

  File path:
  magento/app/code/Vendor/CustomModule/etc/webapi_rest/events.xml

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

  File path:
  magento/app/code/Vendor/CustomModule/Observer/CustomPrice.php

<?php
namespace Vendor\CustomModule\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Exception\InputException;

class CustomPrice implements ObserverInterface
{
    protected $request;

    public function __construct(
        \Magento\Framework\App\RequestInterface $request
    )
    {
        $this->request = $request;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        echo "Calling observer.....";die;
    }
}

Let me know if any have idea about to call add to cart event in rest API.

Any help would be appreciated. Thanks.


texts:
Is there a way to add HTML video instead of relying on Youtube, Vimeo, ...
It's kinda unprofessional looking and it's not kinda hard to have a video tag that links to URL. Seems like this is supported as a Magento Commerce feature from documentation, I should be able to allow my own CDN link to do this kinda stuff. Seems like a very simple feature left out intentionally which looks bad on an open-source project


texts: Shopping cart is empty after cancel the payment in magento-1.9.1.1

texts:
Shopping cart becomes empty after cancel the payment. i am using IWD onepage checkout. My website is Depoto-1.9.1.1

            /**
             * @todo remove wishlist observer processAddToCart
             */
            Mage::dispatchEvent('checkout_cart_add_product_complete',
                array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
            );

            if (!$this->_getSession()->getNoCartRedirect(true)) {
                if (!$cart->getQuote()->getHasError()) {
                    $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
                    $this->_getSession()->addSuccess($message);
                }
                $this->_goBack();
            }
        } catch (Mage_Core_Exception $e) {
            if ($this->_getSession()->getUseNotice(true)) {
                $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage()));
            } else {
                $messages = array_unique(explode("\n", $e->getMessage()));
                foreach ($messages as $message) {
                    $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message));
                }
            }

            $url = $this->_getSession()->getRedirectUrl(true);
            if ($url) {
                $this->getResponse()->setRedirect($url);
            } else {
                $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());
            }
        } catch (Exception $e) {
            $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
            Mage::logException($e);
            $this->_goBack();
        }
    }


texts: Magento 2: Sync inventory of Associated products

texts: We have several sizes under one product. We have one product which can be sent as XS & S, another one which can be sent as M or L. We want to be able to sync inventory for XS & S and M & L. Thanks in advance


texts: Magento2 custom referer URL redirects to correct URL but again redirects to My Account in few seconds

texts:
I have created a custom URL with referer like this:

use Magento\Framework\UrlInterface;
use Magento\Framework\View\Element\Template;

 public function __construct(
    Template\Context $context,
    UrlInterface $urlInterface,
    array $data = []
) {
    parent::__construct($context, $data);
    $this->_urlInterface = $urlInterface;
}
 public function getRefererUrl()
{
    $referenceUrl = $this->_urlInterface->getUrl('burger.html');
    $redirectUrl = $this->_urlInterface->getUrl('customer/account/login', array('referer'=>base64_encode($referenceUrl)));
    return $redirectUrl;

}

After this I am able to get a URL containing referer also after customer login it is redirecting to correct referer URL.

The issue is that after it redirects to referer URL it again redirects to My-Account, not sure why this is happening.

Checked the admin settings and it is set to NO to redirect to MyAccount after login under:

CusotmerConfiguration > Login Option > Redirect Customer to Account Dashboard after Logging in (it is NO)

Also after simple login process as well (without my custom created referer link) I am not redirected to My-Account.

Any ideas why I have been again redirected to My-Account when using my custom referer URL.


texts: Magento 2 : Add product to comapre using product ID programetically

texts: I need to add a product to compare using a product id in Magento2.


texts: Invalid Form key.Please refresh the page

texts:
If I visit my website first time it give me an error of Invalid form key.Please try again lator.
It is giving same error while add product in the cart and it directs the page to the Home page in browser Mozilla,Safari and Chrome.

I did a following changes to resolve this issue in Admin.
Store->Configuration->Advanced->System->Full Page Cache.
It resolved the issue for short time.When I visit same after5-6 hours it gives me same error on the staging server.

Please specify the best solutions of this issue.


texts:
The problem is when I try to add a non-veg item to the cart, it is not adding. But when i come back and add other products like fish, fruits etc to the cart and again go back and add that non-veg item, it is adding. And when added to the cart, the price is displaying as 0.00.
Can anyone please help me why the non-veg item is not adding to the cart first time and the price issue ?????


texts: Magento 2. In which database table is catalogsearch_fulltext index saved?

texts: In which table is information produced by catalogsearch_fulltext index saved when SQL is set as a search engine?


texts: Magento 1.9.3.0 file was not uploaded error

texts: When I upload the product background and click upload pictures, it always prompt, this file was not uploaded error


texts: Display shopping cart only when salable products are displayed

texts:
In Magento 2 I want to be able to display the shopping cart (e.g. minicart) in the header of the shop only when products are displayed on the page that are salable. The shop I'm building has two types of products:

Products that are displayed as informative products (as a catalogue without purchase ability).
Products that should be purchased.

The last one will only be displayed in one (or maybe two) categories.


texts:
I create form on success page with id varification-sms-code and add class input-text required-entry validate-email but not working

var validator = new Validation('varification-sms-code', {immediate : true});
validator.validate();


texts: Getting resulting size of Catalog Image Helper resize function

texts:
I am using the catalog helper resize function like this:

Mage::helper('catalog/image')->init($this->getProduct(), 'image', $before_image->getFile())->keepFrame(false)->constrainOnly(true)->resize(800, 600);

This will return the full image size unless it is larger than 800x600.

When it is larger than 800x600, I need to get the resulting size of the resized image. I have pored over the Mage_Catalog_Helper_Image file and cannot find anything that will give me the resulting size.

Is there any method outside of parsing the resulting URL to locate the cached file on my hard drive to determine the final image dimensions?


texts: Attributes missing when a product is loaded via grouped products

texts:
I have some simple products which are associated to a grouped product.

If I load the simple product separately, the attribute tax_class_id is set, but if the product is contained in a grouped product (fetched in \Example_CatalogGrouped_Model_Product_Type_Grouped::getAssociatedProducts), the tax_class_id is empty.

In the backend, the value is present.

Logging the SQL queries revealed, that the data is loaded from the EAV.

The query contains the following part (attribute id of tax_class_id is 85), but the value is not present in the result:

Checking the query which loaded the products, there is a the condition

UNION ALL SELECT
            `t_d`.`entity_id`,
            `t_d`.`attribute_id`,
            `t_d`.`value`                                  AS `default_value`,
            `t_s`.`value`                                  AS `store_value`,
            IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value`
          FROM `catalog_product_entity_int` AS `t_d`
            LEFT JOIN `catalog_product_entity_int` AS `t_s`
              ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 1
          WHERE (t_d.entity_id IN (7497)) AND (t_d.attribute_id IN
                   ( .... , '85', .... ))
                AND (t_d.store_id = 0)


texts: Calling helper functions from within cron job file

texts:
I am trying to run tests on helper functions, so I created a cron job to test them. I have already verified that the cronjob itself is set up correctly (it is running when I have simple logging statements in it). Now I want to set it up to run functions from my helper file.

In config.xml:

...
<crontab>
    <jobs>
        <testjob>
            <schedule><cron_expr>*/1 * * * *</cron_expr></schedule>
            <run><model>module/crontest::testSuite</model></run>
        </testjob>
    </jobs>
</crontab>
<helpers>
        <module>
            <class>Namespace_Module_Helper</class>
        </module>
    </helpers>
...

Then in my Crontest.php file, under Model:

class Namespace_Module_Model_Crontest
{
protected $helper = Mage::helper('module');
protected $testData = null;

public function testSuite() {
    Mage::log("HELPER FUNCTION TESTS", null, 'test.log', true);

    $testData = $helper->getApiUrl();
    Mage::log("Ran getApiUrl: {$testData}", null, 'test.log', true);
}

When this runs (every minute), nothing appears in any log file. However, I believe I have narrowed down the problem to the first variable declaration: $helper. I think I'm doing that wrong, because when that line was removed, I got errors, and it was evident that the cron job was running. But with the line, it's failing silently and I'm not sure why. What is wrong with how I'm calling the helper functions?


texts:
I need to create 4 new customer attributes in my magento store. I have created a module as below to do so:

Customerattribute >
    etc > config.xml
    Model > Mysql4 > Setup.php
    sql > customerattribute_setup > mysql4-install-0.0.1.php

config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <Custom_Customerattribute>
      <version>0.0.1</version>
    </Custom_Customerattribute>
  </modules>
    <global>
        <resources>
            <customerattribute_setup>
                <setup>
                    <module>Custom_Customerattribute</module>
                    <class>Custom_Customerattribute_Model_Mysql4_Setup</class>
                </setup>
                ....
            </customerattribute_setup>
        </resources>
    </global>
</config>

Setup.php

class Custom_Customerattribute_Model_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
{
    /**
     * This method returns true if the attribute exists.
     *
     * @param string|int $entityTypeId
     * @param string|int $attributeId
     * @return bool
     */
    public function attributeExists($entityTypeId, $attributeId)
    {
        try
        {
            $entityTypeId = $this->getEntityTypeId($entityTypeId);
            $attributeId = $this->getAttributeId($entityTypeId, $attributeId);
            return !empty($attributeId);
        }
        catch(Exception $e)
        {
            return FALSE;
        }
    }
}

mysql4-install-0.0.1.php

$installer = $this;
$installer->startSetup();
$entity = $installer->getEntityTypeId('customer');

if(!$installer->attributeExists($entity, 'paypal')) {
    $installer->removeAttribute($entity, 'paypal');
}

$installer->addAttribute($entity, 'paypal', array(
        'type' => 'text',
        'label' => 'Paypal',
        'input' => 'text',
        'visible' => TRUE,
        'required' => FALSE,
        'default_value' => '',
        'adminhtml_only' => '0'
));

$forms = array(
    'adminhtml_customer',
    'customer_account_edit'
);
$attribute = Mage::getSingleton('eav/config')->getAttribute($installer->getEntityTypeId('customer'), 'paypal');
$attribute->setData('used_in_forms', $forms);
$attribute->save();

$installer->endSetup();

This works for my first customer attribute of paypal but i now want to be able to add 3 others. I had hoped that if i change the mysql4-install-0.0.1.php file to say this:

$installer = $this;
$installer->startSetup();
$entity = $installer->getEntityTypeId('customer');

if(!$installer->attributeExists($entity, 'attribute_2')) {
    $installer->removeAttribute($entity, 'attribute_2');
}

$installer->addAttribute($entity, 'attribute_2', array(
        'type' => 'text',
        'label' => 'Attribute 2',
        'input' => 'text',
        'visible' => TRUE,
        'required' => FALSE,
        'default_value' => '',
        'adminhtml_only' => '0'
));

$forms = array(
    'adminhtml_customer',
    'customer_account_edit'
);
$attribute = Mage::getSingleton('eav/config')->getAttribute($installer->getEntityTypeId('customer'), 'attribute_2');
$attribute->setData('used_in_forms', $forms);
$attribute->save();

$installer->endSetup();

and uploaded the new file and went back onto the site attribute_2 would be added but it isn't.

Why does this work once but not again?


texts: How to make the address field "company" required?

texts: I simply would like to make the field "company" on the onepage checkout a required field. Would be happy for some help? I tried it already but it didn't work, so probably I have to change or add some more data in another file.


texts: How to create custom checkbox field for term and conditions in one page checkout page magento2

texts:
I am new to magento2. I want to create a custom checkbox for a required option without checked checkbox customer cannot place an order.
How to create terms and conditions checkbox custom field using custom code.
I have an issue with magento2 default terms and conditions it is not working.


texts: Hide category from top navigation but show in side navigation?

texts:
Is it possible to hide a child category from top navigation (selecting show in navigation as NO), but have it visible on side navigation in product listing pages?

Any extensions for this? Thanks.


texts: Configurable products..... Am I missing something?

texts:
I am quite a new user to Magento. Currently using 1.9.2.1 with 3rd party theme.

I am setting up configurable products. I see on the shop side any combination not available still shows up as a drop down option but is "greyed out" so it cant be selected. Is this a new thing?

I am sure an older version I used a while back any combination not available just didnt show on the drop downs. Also the Youtube vids I have watched about setting up configurables shows it so when something is not an available option it doesnt show.

It has been driving me mad as I am sure it used to do this. Either Magento has changed standard behaviour or I have changed an option setting somewhere and cant find how to change it back!

I even installed a default store on a spare domain just to check how it works "out the box"

Can anyone shed some light on this please!! Thank you :)


texts: Magento 2 : Duplicate notification message on Mobile device

texts:
I followed this link to remove all my duplicate messages.

  Error/Success messages show wrong page and are not cleared

It worked for desktop chrome. But when test it on actual device like android and iphone
It shows duplicate as well as previous all messages.

It works perfectly for desktop chrome/safari.
How to fix this?


texts: Multiple Websites ( Separate Domains) on single Magento Instance (Problem: New Domain , routing to first website instead of new website )

texts:
I am working on a Magento 2.2.7 running on Apache/Linux/Cloudways. Before I started working here, three websites were already setup to run on a single magento instance. Microbattery.com , HearingAidBatteryShop.com, and cochlearbatteries.com. I am now trying to add a third site using the magento backend. I created the website, store and storeview for hearing-aid-batteries.com and its pointed to our servers. I modified the rewrites in the .htaccess file of my magento directory but hearing-aid-batteries.com is redirecting to microbattery.com for some reason.

I have tried the following: php bin/magento cache:clean php bin/magento cache:flush rm -rf var/cache/* php bin/magento reindexer:index

I checked the tmp director to see if any cache files were being stored in there.

I changed the base url for hearing-aid-batteries.com to http://hearing-aid-batteries.com

All of these things still result in the same issue.

hearing-aid-batteries.com redirects to microbattery.com

.htaccess and sitemap config

SetEnvIf Host wwww\.hearing-aid-batteries\.com MAGE_RUN_CODE=habaffiliate
SetEnvIf Host staging\.hearing-aid-batteries\.com MAGE_RUN_CODE=habaffiliate
SetEnvIf Host www\.hearing-aid-batteries\.com MAGE_RUN_TYPE=website
setEnvIf Host staging.\hearing-aid-batteries\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^hearing-aid-batteries\.com MAGE_RUN_CODE=habaffiliate
SetEnvIf Host ^hearing-aid-batteries\.com MAGE_RUN_TYPE=website

RewriteCond %{HTTP_HOST} ^.*hearing-aid-batteries\.com$
RewriteRule ^sitemap.xml$ /aff/sitemap.xml [NC,L,R=301]

RewriteCond %{HTTP_HOST} ^hearing-aid-batteries.com [NC]
RewriteRule ^(.*)$ https://www.hearing-aid-batteries.com/$1 [L,R=301,NC]


texts:
I tried to add (enable) new payment method on the Magento 2 but unfortunately the enabled option does not shown on the checkout page, here is my checkout page snapshot:

Here is my Enable Payment Method:

My Question is how to show my new Payment Method on the checkout page?

Any help would be very appreciated.


texts: Magento 2.0.5 Product Image Import error 'timeout or permissions'

texts:
I've spent best part of a day trying to upload products to a magento 2 store with little success.

The problem suggests it's a timeout or permissions error, yet i've checked all of these:

PHP Execution time
Files and folder are set to 755
Have tried fetching files from /pub/media/import
Have tried fetching files from /var/customfolder
Have tried variations of paths above to include /home/domain/public_html/..
Have tried leaving the image path field blank
Have tried using a complete http://domain/pub/media/import url
Have CHMOD all the images in question to 755 to overwrite erroneous permissions
Have varied the format of the .csv upload (image url with /beforeimage.jpg)

File upload size is set to 10Mb and the file is 4mb
Fresh install of magento 2.0.5 via web setup on php 5.5 apache linux server

The only solutions i've managed to find suggest installing php 7, which i'm informed is a total catastrophe of a build so won't be doing that.

Sure someone's come across the same issue surely?! I'm stumped!


texts: Magento 2 : How to write a custom extension?

texts: There is already a question on how to write a custom extension at How to write a custom extension? , but most of the answers I read , while being good and really detailed are about magento 1, so felt the need to ask it again.


texts: UI Component form show dropdown or multiple text fields based on content

texts:
I have a form for adding animals with a field called species. This UI Component is:
<field formElement="select" name="species" sortOrder="10">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="source" xsi:type="string">Animal</item>
        </item>
    </argument>
    <settings>
        <dataType>text</dataType>
        <label translate="true">Species</label>
        <dataScope>species</dataScope>
        <validation>
            <rule name="required-entry" xsi:type="boolean">false</rule>
        </validation>
    </settings>
    <formElements>
        <select>
            <settings>
                <options class="Vendor\Module\Model\Config\Source\Species"/>
            </settings>
        </select>
    </formElements>
</field>

Vendor\Module\Model\Config\Source\Species returns an array of animals (e.g. cat, dog, cow, horse).
The issue is that, the client has asked that if the customer has more than 1 animal to show then an extra species field should come for each animal. The developer at the time has coded this on the front end to save the multiple species as a json.
But it gets worse, they've also coded the json to have a second question - 'amount' as well, which shows how many of each animal the customer has.
An example of the json is:
[{"species":"Horse","amount":"4"},{"species":"Cat","amount":"2"}]

How do I modify my UI Component form (Vendor\Module\view\adminhtml\ui_component\animal_form.xml) to show a drop-down when the value is from the source array ('cat', 'dog', etc), and multiple fields (perhaps in a table?) of species and amounts if the response is in json?


texts: Is there a way to insert products through the spread sheet programmatically?

texts:
Is there a way to send products into magento or edit them in any way programmatically without going through the API.

I understand one can load products and edit products by putting them in a spread sheet, then load that spreadsheet into magento manually.
If I have a spread sheet on my computer, is there a way to send it to magento through curl or what have you?

I ask because I'm currently spitting 100 or so records up using the api_v1 multi call, and while it works I have 10,000 products and my client would like to see what got sent, and what failed. Using the API is fine for my app, but If I could push my products into a CSV my client would be happier.


texts: "Missing Tax Forms" while submitting Magento extension

texts:
I have submitted two of my extensions to magento marketplace. It passed

Technical
QA Review

But I got stuck in a "Marketing issue" it says "Missing Tax Forms"

I had done research and finally find out I have to submit a form W-8BEN as I am from India & an individual developer.

Now I couldn't find a link in magento where I can submit this form.

I have two question

Do I need to fill and prepare a scan copy of this form?
To submit form is there any link or i need to send mail to marketplace@magento.com ?

I found one question here relevant to me but it has no answers.


texts: Exclude Parent category ids from array of category id's

texts:
Hi i'm having a product collection, i'm getting those categories by $item->getCategoryIds();

On  print_r($categoryIds = $item->getCategoryIds()); i'm getting

    Array
(
    [0] => 12
    [1] => 26
)
Array
(
    [0] => 22
    [1] => 26
)
Array
(
    [0] => 12
    [1] => 26
)
Array
(
    [0] => 12
    [1] => 26
)

In these category id 12 is parent for categories 26,22

So is there any way to exclude parent category i.e 12 from array ? Smething like this i'm looking for

    Array
(
    [0] => 26
)
Array
(
    [0] => 22
    [1] => 26
)
Array
(
    [0] => 26
)
Array
(
    [0] => 26
)


texts: Save admin product attribute in Magento 2.1

texts:
I am new to Magento 2.1 and still working out most things about it.

I've created a custom module to add an attribute to admin add/edit product page. It's a very simple set up of a title and text area. I've managed to setup:upgrade & setup:di:compile the module with no issues. It's showing within the admin add/edit product page. What's it not doing is saving any value I enter into textarea and save. This is where my knowledge starts to fall short.

here is my code

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\Catalog\Model\Category" type="Fellowship\PorductPriceMeassage\Model\Category" />
</config>

module.xml

<?xml version="1.0"?>
<!-- file: app/code/Fellowship/CategoryAttribute/etc/module.xml -->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Fellowship_PorductPriceMeassage" setup_version="1.0.2" >
        <sequence>
                <module name="Magento_Catalog"/>
            </sequence>
        </module>
</config>

ui_component > product_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- file: app/code/Fellowship/PorductPriceMeassage/view/adminhtml/ui_component/category_form.xml -->

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="product-details">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Price Message</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">100</item>
            </item>
        </argument>
        <field name="price_meassage">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">15</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">textarea</item>
                    <item name="label" xsi:type="string" translate="true">Price Message</item>
                    <item name="required" xsi:type="boolean">false</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

I am not 100% sure, but I suspect that, it's the code used in di & module xml which is stopping the value from being saved.

I will be very grateful if anyone could point out that where I am going wrong.


texts: Magento 2.3.4 use system value checkbox disabled not able to uncheck the box

texts:
Can someone help me out from this issue? I have installed Magento 2.3.4 CE in my local system then I just want to enable the DHL shipping method but I am not able to do that because 'use system value' checkbox itself disabled If I change the store view also no luck.
Note : not only DHL, all system configurations checkbox disabled.


texts: addStoreFilter not working with custom collection

texts:
I am using addStoreFilter with my custom collection but it won't work.

it gives null result.

My DB column name is store_id

for specific store it store like 1,2,3 abd for all store it will store 0

code is as below.

 $collection=Mage::getModel('productline/productline')->getCollection()
    ->addFieldToFilter('status','1')
    ->setOrder('sort_order','ASC')
    ->addStoreFilter();

Please help on this.


texts:
I have configured cronjob in my server and confirmed its working fine. Also I have configured cronjob in my custom module but its not working.
Here is my custom module coding for cronjob :

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Module>
            <version>0.0.1</version>
        </Company_Module>
    </modules>
<global>
    <models>
        <company_module>
            <class>Company_Module_Model</class>
        </company_module>
    </models>
</global>
    <crontab>
        <jobs>
            <company_module>
                <schedule>
                    <cron_expr>*/5 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>module/observer::moduleUpdate</model>
                </run>
            </company_module>
        </jobs>
    </crontab>
    <frontend>
        <routers>
            <Company_Module_First>
                <use>standard</use>
                <args>
                    <module>Company_Module</module>
                    <frontName>company-module</frontName>
                </args>
            </Company_Module_First>
        </routers>
    </frontend>
</config>

Observer.php

class Company_Module_Model_Observer
{
    public function moduleUpdate()
    {
        Mage::log('Cron Working', null, 'cron.log', true);
    }
}

Note : Here I have generated cron.log file for every 5 mins to check whether cron is working. But cron.log file is not generating. I have confirmed cron is working in server.

Why cron.log file is not generating?

Any helps are welcome with thanks.


texts:
How can I solve this kind of error after transferring my magento file and SQL to new hosting?

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'session_id' in 'field list'

Please see this screenshot for the error:


texts: Upgrade to 2.3.5-p1 , module breaks bin/magento, how to disable?

texts:
I have just upgraded my development environment to Magento 2.3.5-p1 using:

  composer require magento/product-community-edition=2.3.5-p1
  composer update

Running the bin/magento command line crashes on start with a fatal error.

  PHP Fatal error:  Uncaught Error: Cannot instantiate interface
  Magento\Cron\Model\DeadlockRetrierInterface in
  /var/www/import/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:5

After some trial & error, I have managed to find the offending code (Magento\Cron\Model\Schedule:87) and the 3rd party module that triggered it.

How do I cleanly disable the module? I cannot run bin/magento module:disable as it won't even start.

Removing it from app/etc/config.php is not sufficient. If I move the module out of the way, and empty /generated/code, it stills triggers error about missing code.

In ClassReader.php line 26:

  Class Potato\Crawler\Model\Command\Queue does not exist


texts: Disable date not working in magento 1.9 frontend

texts:
code:

<script type="text/javascript">
// <![CDATA[
Calendar.setup({
inputField : 'shipping_arrival_date',
ifFormat : '%m-%d-%Y',
showsTime: false,
button : 'shipping_arrival_date_trig',
 align: "Bl",
singleClick : true,
dateStatusFunc : disabledDate,

disableFunc: function(date) {
//disable previous day in datepicker
var now= new Date();
if(date.getFullYear()<now.getFullYear())
{
return true;
}
if(date.getFullYear()==now.getFullYear())
{
if(date.getMonth()<now.getMonth())
{
return true;
}
}
if(date.getMonth()==now.getMonth())
{
if(date.getDate()<now.getDate())
{
return true;
}
}
},
});

function disabledDate(date) {
    var today = new Date();
    return (["3-12-2019", "3-15-2019"].indexOf(date.getDate()) !== -1) ? true : false;
};
// ]]>
</script>


texts:
I would like to restrict customers to purchase who are below 18 years of age to my website.
I would like to add a popup on my index like this http://prntscr.com/3wgag2
It should have 2 Buttons of Yes and No.

Can Anyone help me with the same ! I'm currently using Toocas plugin but that doesn't support what I requite.


texts: After adding a custom css, it does not render in Magento 2?

texts:
I create template name is Demo in magento2.

in default_heade_blocks.xml i use

<link src="css/custom.css"  media="all" />

but it not render when i view-source.
I not found it in pub/static/../demo/css folder.
I tried


texts: I Want to integrate sms module on checkout

texts:
I have purchased my desired sms API and i have also written the code for that just need to invoke my code on checkout button how can you help me.
Looking for a quick and easy solution
Thanks


texts:
I've installed AdFab Avatar extension. It has 2 methods that interest me: getAvatarValid and setAvatar.

setAvatar is called on $_avatar in some .phtml files and getAvatarValid called via $customer->getAvatarValid() in Observer.php.

I wanted to check the source of these methods so I did grep -r "n setAvatar(for both functions) on the whole Magento folder. I didn't get any result. How come? Are they saved in the database :)?


texts:
I am a noob of Magento 1.9.
I have these custom module files:
app/code/local/mypackage/custommodule/block/mymodulename.php
app/code/local/mypackage/custommodule/etc/config.xml
app/code/local/mypackage/custommodule/templates/mymodulename.phtml
app/code/local/mypackage/custommodule/templates/mymodulename_1.phtml
app/code/local/mypackage/custommodule/templates/mymodulename_2.phtml

I've added some code to block/mymodulename.php and then I want to use that module in the homepage with the template called mymodulename_2.phtml.
mymodulename_1 is already working correctly elsewhere in my site but I don't know how (cause I'm noob).
This is the config.xml of the module:
<?xml version="1.0"?>
<config>
    <modules>
        <Mypackage_Custommodule>
            <version>1.0.0</version>
        </Mypackage_Custommodule>
    </modules>
    <global>
        <blocks>
            <mypackagecustommodule>
                <class>Mypackage_Custommodule_Block</class>
            </mypackagecustommodule>
        </blocks>
    </global>
</config>

I've tried to put the module in the homepage with
app/design/frontend/mytheme/mypackage/layout/local.xml

<cms_index_index>
    <reference name="content">
       <block type="mypackagecustommodule/mymodulename" name="mypackage_custommodule_mymodulename_2" template="mypackagecustommodule/mymodulename_2.phtml"/>
    </reference>
</cms_index_index>

The result is this and I don't know why it can't find the file:
File not found in
/home/mypackage/mypackagemagento/app/code/core/Mage/Core/Block/Template.php
0 /home/mypackage/mypackagemagento/app/code/core/Mage/Core/Block/Template.php(241):
mageCoreErrorHandler()
1 /home/mypackage/mypackagemagento/app/code/local/Mypackage/Custommodule/Block/mymodulename.php(29):
Mage_Core_Block_Template->fetchView()

Thank you in advice.


texts: Product view does not work after the search results page. Magento2

texts:
When I  go to the product view  through the catalog view page  after that it's

works when i go to from search result, but if i don't open product view trough

catalog view, when i go from search result to the product view , page is blank.

Thanks for help.


texts: Show configurable products on product info page

texts:
I am trying to show configurable products in the upsell block on the product info page.
i have already "linked" the products, cleared cache and reindexed data. but still not showing up.


texts:
What is the code that generates the ExtensionInterface suffixed classes ?

For example, there is this file that declares extension attribute on the product options (and others). Magento/Catalog/etc/extension_attributes.xml.

Here is a sample if it.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Quote\Api\Data\ProductOptionInterface">
        <attribute code="custom_options" type="Magento\Catalog\Api\Data\CustomOptionInterface[]" />
    </extension_attributes>
    ....
</config>

This declaration will add the methods getCustomOptions and getCustomOptions in the autogenrated interface Magento\Catalog\Api\Data\ProductOptionExtensionInterface and in the implementation of this class Magento\Catalog\Api\Data\ProductOptionExtension (both located in the generated/code folder).

My question is simple. What is the code that reads the extension_attributes.xml files and generates the interfaces and classes?

(PS. I don't want an explanation on how to add my own attributes).


texts: How to get the public product url for simple products (not visible individually)

texts: I am getting the 404 error every time I am trying to get the correct URL for a product. I want to go to the specific url for that product, is there a specific magento solution to do this? I tried with addUrlRewrite and getProductUrl or getUrlPath. Nothing seems to do the trick.


texts:
I have developed Magento website version 1.9.2.4. Now i want to create custom extension for email reminder which provide configure two field.

Hours before email is sent
Email address(es) to send email to (separated by commas)

The purpose of email reminder is any order that hasn't been processed in last 24 hours.


texts:
I want to know, what is the correct way to implement CRUD operations in Magento 2?

because I found a lot of examples but they use deprecated methods.

I created a table ('quote reserved item') with some.
id (PK)
quote_id FK on entity_id form quote table.
product_id.

I want to save update and read information from this table. So i created the following classes :

Api\ReservedItemRepositoryInterface.php that has a method save();
Api\Data\ReservedItemInterface.php

Model\ResourceModel\ReservedItem\Collection.php
Model\ResourceModel\ReservedItem.php Model\ReservedItem.php
Model\ReservedItemRepository.php here i want to implement that save
method without using deprecated methods. If that is not possible
which method should i use.

class ReservedItemRepository implements ReservedItemRepositoryInterface{

protected $collectionFactory;

protected $reservedItemFactory;

public function __construct(
    CollectionFactory $collectionFactory,
    ReservedItemFactory $reservedItemFactory
)
{
    $this->collectionFactory = $collectionFactory;
    $this->reservedItemFactory = $reservedItemFactory;
}

/**
 * @param ReservedItemInterface $reservedItem
 * @return ReservedItemInterface
 */
public function save(ReservedItemInterface $reservedItem, $saveOptions = false)
{

}


texts: Best pratices to update the module-checkout

texts:
I want to add some custom text test to my mini top cart in my theme header section. I see it is located here:

public_html/m2/vendor/magento/module-checkout/view/frontend/templates/cart/minicart.phtml

When I edit this file and clear cache I can see my test showing on the site fine,

However a friend of mine told me I should not be editing files located in /vendor directory

So if I wanted to add my minicar.phtml with my own text inside this where would I add this file in my theme ? which directory would override me needing to edit any files in vendor?

Thanks


texts: How can I add default breadcrumbs to cms Page?

texts:
I want to add to my home page (Cms) the breadcrumbs on top, I have allready enabled it in the admin area and also added it in the layout file like so:

<referenceBlock name="breadcrumbs">
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">Home</argument>
                <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string">Home</item>
                    <item name="label" xsi:type="string">Home</item>
                    <item name="link" xsi:type="string">{{baseUrl}}</item>
                </argument>
            </action>
        </referenceBlock>

This is fine but when I visit for example a category page the breadcrumbs is all messed up:

I know that the layout I added is a custom one so that's why I see Home in front page but I am not sure how to fix it.

EDITED

I found a way to make this work, basicly I change the way the breadcrumbs is called in the layout file, I changed it to :

<referenceBlock name="breadcrumbs" template="Magento_Catalog::product/breadcrumbs.phtml">
            <arguments>
                <argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\Breadcrumbs</argument>
            </arguments>
        </referenceBlock>

Here is the result:

This did the fix for me, but if anyone know how to add the breadcrumbs in another way it would help me aswell, thanks