texts: remove add to cart button from home page Luma

texts: how can i remove or hide the "Add to Cart" button on my home page and category pages? I am using Magento 2.1 Luma as my main template


texts: I want to create custom category attributes dynamically in admin. I mean, how can I create custom category attributes in my Model class? Please suggest me proper solution to resolve this issue.


texts: How to integrate reCAPTCHA v3 in magento 1.9?

texts: I am integrating reCAPTCHA v3 in my magento on registration page and contact form, but I am not getting any help on this as this is new version. Can some one guide me on this. I found we can create keys from https://g.co/recaptcha/v3.


texts: Product image upload button has changed to 'couldn't load plugin'

texts:
On the images section of the product upload, the button that usually says upload has changed to 'couldn't load plugin'.

Any idea why this is happening or how I can fix it?


texts: Magento Go - Excluding a partial search term

texts:
I was wondering if there is a way to exclude certain words from a search in Magento. For example if I had three products:

Red Car
Big Car
Nice Car (great names I know)

So if someone searched 'red car', I only want them to see the 'red car' product in the search results and not the other two products with 'car' in the title.

Can anyone help me with this?

I realise there is already a post on this:

https://stackoverflow.com/questions/6691841/magento-exclude-search-term

However, it doesn't seem to be answered other than by editing the PHP file. I'm not au fait enough with PHP to write a method to do this...

Many thanks in advance! :-)


texts: Magento 1 - Sales_Order_Place_Before event not working

texts:
I am new to magento. I am using Sales_order_place_before event in my module. I have seen lots of valuable posts/discussions regarding this issue. But I haven't found a solution yet. So I hope someone will help me on this issue.

config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Observersample_Event>
            <version>0.0.1</version>
        </Observersample_Event>
    </modules>
    <global>
        <models>
            <Observersample_Event>
                <class>Observersample_Event_Model</class>
            </Observersample_Event>
        </models>
        <events>
            <slaes_order_place_before>
                <observers>
                    <observersample_event_model_observer>
                        <type>singleton</type>
                        <class>Observersample_Event_Model_Observer</class>
                        <method>example</method>
                    </observersample_event_model_observer>
                </observers>
            </slaes_order_place_before>
        </events>
    </global>
</config>

observer.php:

class Observersample_Event_Model_Observer{

    public function example($observer){

        Mage::log("Order is placed");
    }
}

And I have also enabled the log.


texts: Product multiple prices / attribute values import magento 2

texts:
I need to import multiple prices for one product . For example A mattress with sizes Twin ($100), Double ($200),Queen($300),King($400)

How can I do that in Magento 2? I did not find any guide regarding this issue.

Please help. Many thanks in advance :)


texts: How to customize the address in registration form Magento 2

texts: I want to have the attribute address and region and not post code and country name so how to do that?


texts: Magento2 : How to swap the footer links/contents?

texts: How can I swap these two elements present in the footer section in the Magento 2 I installed ?


texts: How to get final price of a product by rest API?

texts:
I mean the final price that Magento calculated and inserted in catalog_product_index_price table.

It may have applied special price/catalog price rule/tier price, which price is displayed to customer as final price.

Anyone have ideas which API I can use?


texts:
I'm making and slide in function to that product page. So when you are close to the bottom a static block will come visible.

That static block should have a link to an article the link is different from product to product and is set in by a custom product attribute.

The problem is to get that custom attribute into my .js can you help?

What I've done so far

Call in an custom.js in page.xml
Make static block, and call it in at the bottom on view.phtml

custom_att name is article link
The js have only the "do somthing when you are close to bottom" function right now

jQuery(window).scroll(function() {
   if(jQuery(window).scrollTop() + jQuery(window).height() > jQuery(document).height() - 100) {
       alert("near bottom!");
   }
})


texts: Adding new folders to pub directory and accessing?

texts:
I have added a folder in the pub directory
installdir/myfolder

I placed a pdf in the folder
installdir/myfolder/myfile.pdf

When I try accessing the file via a link Magento states that the file cannot be found or that it is "Not Allowed"

What is the correct method of accessing this file?


texts: how to add a Discount price to the Invoice in Magento

texts: In case the product is "In sales" I would like to have in the invoice the price before sales and the discounted price to appear in the invoice. How to do that. Thanks


texts: getLayout()->createBlock()->setdata() not passing variables

texts:
Im trying to pass information from my controller to the template.

My Controller:

    $response= "test"; (variable that I want to pass to PHTML)

    $this->loadLayout( array('default','path_to_test_phtml'));

    $block = $this->getLayout()->createBlock('block_name')
        ->setData('response', $response)
        ->setTemplate('path_to_test.phtml');
    $block->setResponse($response); //magic method
    $this->renderLayout();

My Block:

public function _prepareLayout()
{

    return parent::_prepareLayout();
}

My Template:

<?php
$response = $this->getResponse();
?>
<?php echo $this->response; ?>

My Layout:

<path_to_test_phtml>
        <reference name="content">
            <block type="block/name" name="track_bynumber" template="path_to_test_phtml.phtml"/>
        </reference>
</path_to_test_phtml>

No information "test" appear in the template.. any help appreciated. brgds


texts: fetchCol on collection returning same values

texts:
I'm attempting to retrieve the entire column of both kit_sku and related_sku.  However, it doesn't seem to parse correctly.  Both $componentSkus and $componentRequiredQuantity are returning identical arrays.

        $kitCollection = Mage::getModel('path/path')
            ->getCollection()
            ->addFieldToFilter('kit_sku', $sku)
            ->setOrder('related_sku', 'ASC');

        $select = $kitCollection->getSelect();

        $select->reset(Zend_Db_Select::COLUMNS)
            ->distinct()
            ->columns('related_sku')
            ->columns('required_quantity');

        $connection = $kitCollection->getConnection();

        $componentSkus = $connection->fetchCol($select, 0);

        $componentRequiredQuantity = $connection->fetchCol($select, 1);


texts:
I have one foreach loop and I need to add custom html to every fourth row and it is completed.
Now I need to add dynamic array data into every fourth row like first 4th it will come first array value and 8th row it will come 2 array value.

How can I achieve that?


texts: Our store has thousands of color attributes and we want to clean out the ones that are old, inactive, or unused. Is there a solution for this? Is there an easy way to see what attributes aren't currently being used?


texts: Magento 2 - Create product and assign to category via API using category string

texts:
Is there a best practice for creating a product via the API and assigning it to a category with the full category string?  I can only find methods using known category_id

I'd like to use a process similar to a CSV import where I can pass the full path in the API call:
Default Category/Shop by Department/Slide-Outs/Through-Frame & Above-Floor/Gear Packs & Hardware

Instead of an ID like 127

This way it will link the product to a category if it exists, or create one if it doesn't the way an import CSV operates.


texts: need to change product category page layout in magento 1.9

texts:
Check out
http://www.discountsignsupplies.com/products/removal-fluids

Under the product category title ("Removal Fluids") I need to...

1) Remove the header image
2) move the 5 images ABOVE the descriptive text/copy.

I have limited developer knowledge so hoping to do this as quickly and easily as possible, preferably via the admin if possible. I looked under CATEGORY > MANAGE CATEGORIES but nothing stood out for me.

Any help/thoughts?


texts: I want to display the error messages in payment and review page. Anyone has idea how to do it?


texts: How can I used Magento php variable with java-script

texts:
I am trying print Magento current date value in javascript counter Functions but it only shows the result of some strings.

Here is php variable:

 <?php echo $date=$_item->getData('special_to_date');?>

HERE is the js code I want to use $data variable in my js date function:

    <script>
    // Set the date we're counting down to
    //var countDownDate = new Date("Jan 5, 2018 15:37:25").getTime();
var countDownDate = new Date("$data").getTime();

    // Update the count down every 1 second
    var x = setInterval(function() {

      // Get todays date and time
      var now = new Date().getTime();

      // Find the distance between now an the count down date
      var distance = countDownDate - now;

      // Time calculations for days, hours, minutes and seconds
      var days = Math.floor(distance / (1000 * 60 * 60 * 24));
      var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
      var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
      var seconds = Math.floor((distance % (1000 * 60)) / 1000);

      // Display the result in the element with id="demo"
      document.getElementById("demo").innerHTML = days + "d " + hours + "h "
      + minutes + "m " + seconds + "s ";

      // If the count down is finished, write some text
      if (distance < 0) {
        clearInterval(x);
        document.getElementById("demo").innerHTML = "EXPIRED";
      }
    }, 1000);
    </script>


texts: Magento 2: Custom button in admin product edit page

texts:
I want to add a custom button in short description near WYSIWYG editor

A button that will contain some text that will be copied when clicked.


texts: How to create an order using mock object in phpunit in Magento?

texts:
I am preparing phpunit tests. I need to create an order using mocking and that order i need to pass in my function.

Please suggest, How can i achieve this ?


texts: Issue with related product rule - Magento2

texts:
We are facing issue on target rule implementation when applying the condition "Product Price is equals or greater than 110 % of Matched Product(s) Price " in Product to Display area.

We are on Magento 2.2.6 Commerce version, please help in resolving the issue.

Issue which is appearing here :

[php7:error] [pid 25408] [client 127.0.0.1:37378] PHP Fatal error: Object of class Magento\Catalog\Api\Data\ProductExtension could not be converted to string in vendor/magento/module-target-rule/Model/ResourceModel/Index.php on line 338


texts: load multiple attributers using load() Magento

texts:
I am using this code but it's not working with multiple parameter. I want only use load() function in magento. You can see below code any please help me.

$attributes = array('entity_id'=> 1684, 'advertise_id'=> 283);
$model= Mage::getModel('catalog/product')->load($attributes);

Thanks for support in advance.


texts: Magento 2 shows 500 error after saving Transactional email logo in the Magento admin

texts:
I did some changes on my magento installation (inside admin panel) but for no logical reason my magento showed me HTTP ERROR 500 I am trying the commands php bin/magento setup:upgrade but everything going ok. Can anyone help me for what is that happend?
I tried to reindex and to flush cache.
My installation is based on plesk and centos 7
Thank you

Suspicious Server Logs from Plesk:
1)Apache error

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught
Zend_Cache_Exception: cache_dir
"/var/www/vhosts/domain/httpdocs/var/cache/" is not writable in /var/www/vhosts/domain/httpdocs/vendor/magento/zendframework1/library/Zend/Cache.php:209\nStack trace:\n#0 /var/www/vhosts/domain/httpdocs/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/var...')\n#1 /var/www/vhosts/domain/httpdocs/vendor/colinmollenhour/cache-backend-file/File.php(87): Zend_Cache_Backend_File->setCacheDir('/var/www/vhosts...')\n#2 /var/www/vhosts/domain/httpdocs/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array)\n#3 /var/www/vhosts/domain/httpdocs/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)\n#4 /var/www/vhosts/domain/httpdocs/vendor/magento/framework/App/Cache/Frontend/Factory.php(155): Zend_Cache::factory('Magento\\\\Framewo...', 'Cm_Ca...\n'


texts: How to redirect to form submission page from controller?

texts:
I implemented a Form with a submission treatment by controller.

At the end of the treatment, I would like to redirect to the form submission page.

I tried several things :

$this->_redirect('*/*/');

and

$this->_redirectReferer();

I also tried to place the form submission url in the form by adding :

<input name="redirect_url" type="hidden" value="<?php echo $this->helper('core/url')->getCurrentUrl() ?>" />

and in the controller :

$post = $this->getRequest()->getPost();
…
$this->_redirect($post['redirect_url']);

But none of these solutions are working…
Any help please?


texts: Magento 2: attribute default checkbox toggle

texts: I have 2 websites sharing the same Magento 2 install. I have data in the short description on one store that I don't want to use anymore as I have the short description defined correctly at All Stores level. How can I check the box on short description for all the products in the one store to have it use 'default'?


texts: Magento 2: After unhold order , order status empty

texts:
If set order status Hold programmatically and if i am trying to unhold From Admin Then order status empty. https://prnt.sc/k2g1ak
Here is my code for set Hold order status:

$orderState = Order::STATE_HOLDED;
$order->setState($orderState)->save();
if($order->canHold()) {
       $order->hold()->save();
}

Is there any another way for set order status as hold? what am I doing wrong? and why order status empty?


texts: Block HTML output cache needs refresh from time to time

texts:
I am the only administrator of the store. I am doing before night a Flush Cache Storage in order to get the following issue. In the morning I visit again the backend and there is a warning message "One or more of the Cache Types are invalidated: Blocks HTML output. Click here to go to Cache Management and refresh cache types."

Blocks HTML output warning reacts once you make changes in backend. Is anyone knowing why Blocks HTML output cache needs a refresh after a few hours without touching the backend?


texts: How to use dynamic blocks with Full Page Cache in Magento 2?

texts:
I am using Magento 2.3.2. I have some dynamics blocks which are getting called in some pages. If I disable FPC, the blocks are working fine. But as we enable FPC, They don't work perfectly.

Also, By calling them with cacheable="false" won't be good as it will disable FPC for full-page not that block. How should I disable Cache for a particular block or any application other solution to fix it.

Thanks in Advance!


texts: 404 not found after creating new website Magento 1.9

texts:
I created new website and new store. I added URL and Designer. After that I wrote in my .htaccess

SetEnvIf Host usatravelshop\.loc MAGE_RUN_CODE=chny
SetEnvIf Host usatravelshop\.loc MAGE_RUN_TYPE=website
SetEnvIf Host www\.dev\.usatravelshop\.com MAGE_RUN_CODE=usatravelshop
SetEnvIf Host www\.dev\.usatravelshop\.com MAGE_RUN_TYPE=website

but when I have tried come to my URL, I have 404.


texts:
I am trying to get product by product_id without using load($product_id) (because load() may take much time) so ,i would like to get product from the product collection using product_id.

Which is the best way to get product in magento?(including minimum execution time)

Please help me anyone!..


texts: Magento 2.3.2 : Site is down every time I install a new extension

texts:
Whenever I upload a new extension to my app/code folder, the site goes systematically down.
I upload it using the magento user so there is no owner issue.
I am in production mode.

More specifically this happens just after registering the extension:

php bin/magento setup:upgrade
php bin/magento cache:flush

Here is the error msg in the browser:

  An error has happened during application run. See exception log for
  details.

I solve the issue the following way:

rm -rf ./var/cache/ ./var/pages_cache/
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy -f
rm -rf ./var/cache/

Then restart varnish and invalidate cdn cache.

However I would really like to solve the underlying issue.

And here is the log exception at the same time:

  [2019-08-25 11:14:04] main.CRITICAL: Class
  Magento\Framework\App\Http\Interceptor does not exist
  {"exception":"[object] (ReflectionException(code: -1): Class
  Magento\Framework\App\Http\Interceptor does not exist at
  /var/www/magento/vendor/magento/framework/Code/Reader/ClassReader.php:19)"}
  []


texts: How can I import related products into Magento 1.9.1.0

texts: 9.1.0 and when importing related products the file seems to run and then we get no information and the related products field has not imported.


texts:
I tried to use jquery_lazyload on Magento 2 & couldn't get it to work.
I loaded it using requirejs-config.js

var config = {
deps: [
    "js/my_script"
],
paths: {
    "LazyLoad": "//cdn.jsdelivr.net/npm/lazyload@2.0.0-beta.2/lazyload"
},
shim: {
    'LazyLoad': {
        deps: ['jquery']
    }
}
};

  & then I added my_script.js

define(["jquery","LazyLoad"], function($) {
"use strict";

$(document).ready(function($) {
    let images = document.querySelectorAll(".lazyload");
    lazyload(images);
});
return;
});

  What I get is this error on console:

lazyload.js:78 Uncaught TypeError: Cannot set property 'settings' of undefined
at LazyLoad (lazyload.js:78)
at Object.execCb (require.js:1650)
at Module.check (require.js:866)
at Module.enable (require.js:1143)
at Module.init (require.js:774)
at callGetModule (require.js:1170)
at Object.completeLoad (require.js:1544)
at HTMLScriptElement.onScriptLoad (require.js:1671)

  Update: The error occurs even when I'm not initializing the lazyload (something in the file itself breaks the requirejs).

UPDATE (solved)
It's working fine with the older version of lazyload (1.9.3), I got the error on v2.0.0. Still, I have no idea why it failed with the newer version though.


texts: How to configure the theme to use Grunt?

texts:
I normally change the file /dev/tools/grunt/configs/themes.js but in the .gitignore we can see a configuration file called /dev/tools/grunt/configs/local-themes.js I'd like to use that file instand a core file.

I try to find something related in the DevDocs, but there's nothing about this new file.

How can I configure my theme using the file /dev/tools/grunt/configs/local-themes.js?

  I don't want to create a new Grunt file or to change the core, like this questions below!

Magento 2 add new theme without changing core files. Grunt


texts:
I have two stores, MainStore and ValentinesStore

They mainly have different products but on the ones that they share such as "Single Hearts" if I click on the product it switches stores.

From: ValentinesStore.com/single-heart-pendants.phtml

To: MainStore.com/single-heart-pendants.phtml

How do I keep them in the same store?


texts: Error in setup upgrade and static content deploy

texts:
I repeatedly getting the following error while I try to execute

php bin/magento setup:upgrade

or

php -d set_time_limit=3600 -d memory_limit=1024M bin/magento setup:di:compile

Please help.


texts: Following 1.9.2.3 update order view from admin page not working?

texts:
Is there a fix this or is it expected that a further imminent update will fix. Is it possible to find information on when a fix may be due?

Site not fully usable with this error in place and although I have a backup prior to update I now have fresh orders stacking up which I will need to re-enter manually I presume if I go back to my backup. Any advice appreciated.


texts: How to get customer default shipping and billing address data (i am after country and postcode)

texts:
I have customer ID - Not sure how to grab the default shipping/billing address.
I can get the current shipping address and billing address but not the default.
Is there any way I could get the default shipping and billing details?


texts: the menu Tarck order not shown in top menu

texts:
I installed this extension Evincemage_Trackorder magento 2 on new project with no other menu it works fine and it appears.

but when i installed it on my project that contain many menu so it does not appear please can any one help me figure out the pb and thanks in advance


texts: Magento 1.9 Failed to load resource: net::ERR_CONNECTION_RESET

texts:
I have downloaded Magento 1.9 from Magento 1.9
Downloaded sample data from Magento Tech Resources

Everything went well, I have created a New Customer account successfully, Placed an Order and Proceeded to Checkout.

But when I tried to click Continue button from BILLING INFORMATION TAB with the Ship to this address option selected, I can't go to the next step.

  I checked on Network tab and found that checkout/onepage/saveBilling status is returning:
   (failed) Or Failed to load resource: net::ERR_CONNECTION_RESET.

I tried to select the second option which is Ship to different address, and the SHIPPING INFORMATION TAB was loaded.

But then again, when I entered a new address then click the Continue button or choose Use billing address, I still got the error but this time, it is checkout/onepage/saveShipping

Did anyone experience this kind of error before?
Looking forward to a solution.
Thanks

Note: It is a fresh install. No modifications made.

EDIT:  FOUND THE SOLUTION ALREADY

  DISABLED SOME EXTRA SHIPPING METHODS LIKE UPS, DHL, AND ETC. Then it works


texts: magento2 API - SOAP connection mystery. Which versions for "stream context"

texts:
I have an existing m1 site and a php script which uses the soap API to synchronize product information (read only). It is on a host I do not control and uses the litespeed server.

I have been trying to test the M2 soap API and it is doing my head in. I cannot seem to get the authorization working. Anything needing not authorization works fine, but anything needing authorization does not.

This script is put on the magento2 folder and here's the key piece

    // echo "<p>result? ".$token->result; (that works!)
$opts = array(
        'http'=>array(
            'header' => 'Authorization: Bearer '.$token)
    );
    $context = stream_context_create($opts);
    $services = "catalogProductRepositoryV1";

    try{

            $client = new SoapClient("http://".$host."/soap/default?wsdl&services=$services",array('soap_version' => SOAP_1_2));
    $client->setStreamContext($context);
            $response = $client->__getFunctions();
            var_dump($response);
   }...

It seems that no matter what I try, the part about setstreamcontext fails so I cannot use the authorization. I have tried passing it as a context array element, streamcontext array element, and using the setStreamContext method, and nothing seems to work.

UPDATE: I first tried

   $client = new SoapClient("http://".$host."/soap/default?wsdl&services=$services",array('soap_version' => SOAP_1_2, 'context'=>$context));

but that doesn't work either. According to PHP documentation, it should work though, as context for passing http header is a documented option. It should therefore pass the Authorization option through?

I am starting to suspect that the way php is set up on this server does not support this context part.

Which versions of PHP support this? Is there any way to do it with the PHP SOAP rather than Zend?


texts:
What is the difference between 3-D secure enabled/disabled in magento paymill payment module? It is necessary to enter the code from credit card code generator every time if 3-D secure is enabled? Can I expect less checkout conversion with 3-D secure enabled?

3-D Secure info sheet is available here: click


texts: Displaying Categories sorting by custom attribute

texts:
How do I pull and display categories according to my custom field "Top_Menu"

$subCats = Mage::getModel('catalog/category')
->addFieldToFilter('Top_Menu', array('eq'=>'146'))
->load($category->getId())
->getChildren();

I keep getting this error

Invalid method Mage_Catalog_Model_Category::addFieldToFilter(Array
(
    [0] => Top_Menu
    [1] => Array
        (
            [eq] => 146
        )

)
)


texts: Magento2 : How to change custom status text color in admin UI Component grid

texts: Change custom module status text color in magento 2 admin UI Component grid


texts: Setting up authorize.net on magento payment bridge

texts:
So I finally have MPB (magento payment bridge) installed and test transactions are submitting fine.

Now I just need help in setting it all up and learning how to take advantage of having the bridge. Can anyone help me with this? I"m new to the payment bridge world but have heard once its setup correctly I can then allow customers to save credit card data as well as having advanced options for order editing/changing/exchanging and credit memos.

Is this the case? I can't seem to find any documentation on how to setup any of this.


texts: I am getting error while changing developer mode to production mode in magento 2

texts:
The detail of error is below:

  Enabled maintenance mode

  Starting compilation

  Something went wrong while compiling generated code. See the error log
  for details. Command returned non-zero exit code: /usr/bin/php7.0 -f
  /var/www/html/magento21/bin/magento setup:di:compile

My Magento version is 2.1.0

Anyone know regarding this problem then please guide me about various steps need to follow?


texts: Avoiding memory exhaustion when updating product stock?

texts:
I need to process a product collection and update the stock quantity and status for each product.

Currently I'm doing this:

foreach($products AS $product) {
    $quantity = $productQuantities[$product->getId()]; // A helper array that I've built before
    Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->setData('is_in_stock', $quantity > 0 ? 1 : 0)->setQty($quantity)->save();
}

This works nicely, but I reach memory exhaustion after about 5k products, and I need to update more than 20k products.

Is there any Magento-internal way of avoiding this?

I do realize I could write directly to the DB, but I'd rather avoid this and go with a Magento-internal function.


texts: Disable paypal express when enabling paypal standard in Magento 1.9.1

texts: I am facing some weird issue. I cannot disable PayPal express checkout on my Magento store running on 1.9.1. I have checked in another version of Magento. The only difference I found is the current store has Merchant Country as Thailand where as other have a country as United state. Please guide me to get this issue solved


texts: How to modify this piece of code to be more magento2 way?

texts:
I've prepared a method to force download file its work fine but I think it's not a Magento way.

header('Content-Disposition: attachment; filename=' .self::PRIVATE_KEY_FILE_NAME . "'");
header('Content-Type: text/plain');
header('Content-Length: ' . strlen($privateKey));
header('Connection: close');
echo $privateKey;

It works fine but I think it could be more magento way style. I tried:

$result = $this->jsonFactory->create();
$result->setHeader('Content-Disposition','filename='.self::PRIVATE_KEY_FILE_NAME . "'");
$result->setHeader('Content-Type', 'text/plain');
$result->setHeader('Content-Length', strlen($privateKey));
$result->setHeader('Connection', 'close');
echo $privateKey;

but it doesn't work as method metioned earlier. It throws fatal error. Any ideas?


texts: How to remove Google Structure Data tags from page

texts:
Magnento default adds following google structured data tags in every page by default.

itemtype
itemscope
itemprop

I want to remove them. I found that you can place below code in your layout xml file.
<attribute name="itemtype" remove="true" />
<attribute name="itemscope" remove="true" />

But this is giving me error for my magento 2.2.6 as below.
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'attribute', attribute 'remove': The attribute 'remove' is not allowed.
Line: 277

Also i tried below.
<attribute name="itemtype" value=""  />
<attribute name="itemscope" value="" />

But that too is also not working.
I can remove them using javascript but want to remove by server side only so that it never render to page.


texts: I am facing error Sorry, no quotes are available for this order at this time.I am using Webshopapps Matrix extension for shipping and import the shipping charges through csv(see below image of csv).For simple i have weights like (5000,0.5000).Can someone tell me why i got this error.Thanks in advance


texts: Magento 1.9.X: how to create custom order attribute?

texts:
How can I create new order attribut using install script?
All my attempts failed and I don't know how to do this.
No one custom order attribute doesn't added to eav_attribute teble.
Help me pls)


texts: After creating new magento account how to open admin panel

texts:
My admin panel was not opening this was giving me to many redirection issue to solve this issue, I had cleared all cache then my admin panel not opening it again redirect to login page.

I also check my account is lock or not but it was unlocked. after that I create new account but how to open admin panel using which link.


texts:
trying to remove the header at the final checkout page using iwd one page checkout extension.
In iwd_opc.xml I added

<remove name="footer"/>

below

<opc_index_index translate="label">

<label>Onepage Checkout</label>

But when I do the same with <remove name="header"/> all the the page goes blank.

How can I remove the header, or at least the menu? Thank you!


texts: How to pass data to update Order tracking number in magento 2 using REST API?

texts:
I am passing data to update tracking code :

$userData = [
    "entity" => [
            "paymentStatusId" => 10
            "orderStatusId" => 8
            "tracking_code" => "237948723894789234"
            "comment" => "Neuer Kommentar"
            "transactionId" => 0
        ]
    ]

$client->put('rest/V1/orders/46',$userData);

But it's returning below response. Please help me in passing the data for update tracking number or any order fields.

Error:

  [2017-01-13 09:48:32] main.CRITICAL: exception 'LogicException'
  with message 'Property "PaymentStatusId" does not have corresponding
  setter in class "Magento\Sales\Api\Data\OrderAddressInterface".' in
  /var/www/html/m2/vendor/magento/framework/Reflection/NameFinder.php:100
      Stack trace:


texts: Magento 2 : "My billing and shipping address are the same" checkbox remain unchecked

texts:
I have created a custom extension for product based cash on delivery.
I have followed the below link for creating the extension.

Disable payment method programmatically in Magento2

Everything works fine,except the billing address checkbox.

If the condition is false, then the COD method is not available and the "My billing and shipping address are the same" checkbox remains checked.

If the condition is true, then the COD method is available. But the  "My billing and shipping address are the same" checkbox will be unchecked.

I am using Magento 2.3.2.

How can I resolve this?


texts: Why do you have to stop Magento 1 cron jobs during migration to Magento 2

texts:
I am preparing for migration from Magento ver. 1.9 to Magento ver. 2.2.

I am trying to fully understand the process and wondering what are the reasons that you have to stop the cron jobs?

All the tutorials say to stop the cron jobs, however, I can't find any information why you have to do it.


texts: When creating an order programmatically how to set different product image

texts:
I'm trying to create order programmatically. But I cannot set a different product image for that order. Here this order image will be send from mobile application. Thats why I need to set different product image without using default one.

protected function _addProductToCart($productId, $qty, $imagePath)
{
    $product = Mage::getModel('catalog/product')->load($productId);
    $cart =  Mage::getSingleton('checkout/cart');
    $session = Mage::getSingleton('customer/session');
    $cart->addProduct($product, $qty);
    $cart->save();
    $quote = $cart->getQuote();
    $quote->setIsTemplate(1);
    $quote->save();

    $quote = Mage::getModel('sales/quote')->load($quote->getId());
    foreach ($quote->getAllItems() as $item) {
      $item->setTemplateImage($imagePath);
      $item->save();
    }
    $quote->save();
    Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
    $session->setCartWasUpdated(true);
}


texts: Magento 1.9 Soap: Uncaught SoapFault exception: [100] Requested order not exists

texts:
I try to get data from sales_order.info.

I connect via $_POST data, where I need to input the order number in a form. When I input a wrong order invalid order number I get a fatal error:

  Fatal error: Uncaught SoapFault exception: [100] Requested order not exists.

How can I modify my code, that instead of fatal error I get my message ("order number not correct, pls try again")

$orderresult = $proxy->call($sessionId, 'sales_order.info', ''.$_POST["ordernumber"].'');


texts: Magento 2 -Limit the length of the product name on the front end.

texts:
I want to limit the length of the product name on the front end. I have the following code in the list.phtml

<a class="product-item-link" href="<?= /* @escapeNotVerified */ $_product->getProductUrl() ?>">
<?= /* @escapeNotVerified */ $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

How I can limit the product name to 50 characters for example?

Thank you


texts: Magento 2: What is Difference between Create & Get ObjectManager?

texts:
I have below code. Which give same result either I use create or get

$orderId = 1;
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$this->orderPayment = $_objectManager->create('Magento\Sales\Api\Data\OrderPaymentInterface')->load($orderId);
$this->orderPayment = $_objectManager->get('Magento\Sales\Api\Data\OrderPaymentInterface')->load($orderId);
echo $this->orderPayment->getLastTransId();

So What is exactly difference between them? Which needs to be used & when?


texts:
Here this is the Magento 1 code would like to convert to M2 code.

$customerId = 1;
$orderCollection = Mage::getResourceModel('sales/order_collection')
        ->addFieldToSelect('*')
        ->addFieldToFilter('customer_id', $customerId)
        ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
        ->setOrder('created_at', 'desc');

Here mainly need to know how to add ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates())) statement in Magento2

Thanks


texts:
Must create a Button which will add assembly price to the basket (assembly is a virtual product).

<!-- ADD ASSEMBLY SERVICE -->

        <?php
            $_sku = 'ASSEM1';
            $_assembly = Mage::getModel('catalog/product')->loadByAttribute('sku',$_sku);
            $url = Mage::helper ( 'checkout/cart' )->getAddUrl ( $_assembly, array ('qty' => 1 ) );
        ?>
            <form method="post" name="form-name" action="<?php echo $url;?>">
            <button type="submit" style="width: 100%;" class="button btn_goto"><?php echo $this->__('Buy Assembly for this product') ?></button>
            </form>
<!-- END ADD ASSEMBLY SERVICE -->

This works but this method redirect to the cart so customer must go back to the product page, but product or buy product then go back again to buy assembly service. Is there any other possible way to add assembly as a product (must be separately added to the invoice). Custom option is not good enough.


texts: how to save the custom time in order comment history in magento 2?

texts:
$orderId = $orderId;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId);
$order->setState(\Magento\Sales\Model\Order::STATE_NEW, true);
$order->setStatus("awaiting_stock");
$order->setUpdate_at(date('2017-03-20 10:14:23', time() - 60*60*24));
$order->addStatusToHistory($order->getStatus(), 'Awaiting Stock');
$order->save();


texts: make sticky header without custom js code

texts:
I tried to make the header sticky using the default jquery code:

    $('.page-header').mage('sticky', {
    container: '.page-wrapper'
});

I added this piece of code into the theme.js file in the web/js directory.
It doesn't work, how to fix that?

Here the complete theme.js code:

/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
define([
    'jquery',
    'mage/smart-keyboard-handler',
    'mage/mage',
    'mage/ie-class-fixer',
    'domReady!'
], function ($, keyboardHandler) {
    'use strict';

    if ($('body').hasClass('checkout-cart-index')) {
        if ($('#co-shipping-method-form .fieldset.rates').length > 0 && $('#co-shipping-method-form .fieldset.rates :checked').length === 0) {
            $('#block-shipping').on('collapsiblecreate', function () {
                $('#block-shipping').collapsible('forceActivate');
            });
        }
    }

    $('.cart-summary').mage('sticky', {
        container: '#maincontent'
    });

    $('.page-header').mage('sticky', {
        container: '.page-wrapper'
    });

    $('.panel.header > .header.links').clone().appendTo('#store\\.links');

    keyboardHandler.apply();
});

UPDATE
I created a sticky.js file inside web/js directory and put the following code:

require([
    'jquery',
    'mage/mage',
    'domReady!'
], function ($) {
    $('.page-header').mage('sticky', {
        container: '.page-wrapper',
        spacingTop: 0
    });
});

I loaded this file in the default.xml:

<head>
    <link src="js/sticky.js"/>
</head>

It doesn't work.


texts:
I am following Alan Storm's tutorial and am getting an error

Controller:

<?php
namespace Pulsestorm\HelloWorldMVVM\Controller\Hello;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\App\Action\Context;
class World extends \Magento\Framework\App\Action\Action
{
    protected $pageFactory;
    public function __construct(Context $context, PageFactory $pageFactory)
    {
        $this->pageFactory = $pageFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
        var_dump(__METHOD__);
        $page_object = $this->pageFactory->create();;
        return $page_object;
    }
}

Error:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Pulsestorm\HelloWorldMVVM\Controller\Hello\World::__construct(), 1 passed in /var/www/html/generated/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World/Interceptor.php on line 14 and exactly 2 expected in /var/www/html/app/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World.php:9 Stack trace: #0 /var/www/html/generated/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World/Interceptor.php(14): Pulsestorm\HelloWorldMVVM\Controller\Hello\World->__construct(Object(Magento\Framework\App\Action\Context)) #1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Pulsestorm\HelloWorldMVVM\Controller\Hello\World\Interceptor->__construct(Object(Magento\Framework\App\Action\Context)) #2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Pulsestorm\\Hell...', Array) #3 /var/www/html/vendor/magento/framework/ObjectManager in /var/www/html/app/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World.php on line 9


texts: Magento2, requirejs-config.js is defined but still Uncaught TypeError is exist

texts:
In requirejs-config.js I have defined the owlcarousel path like below. But still the error Uncaught TypeError: $(...).owlCarousel is not a function(…) does not let product slider in home page work? I have deployed the content and cleared the cache as well.

var config = {
    paths: {
        'owlcarousel': "web/owl.carousel/owl.carousel.js"
    },
    shim: {
        'owlcarousel': {
            deps: ['jquery']
        }
    }
};


texts: Magento 2 - Change order status to 'Complete' using observer

texts:
I am using sales_order_save_after event to change order status. It's working fine for all order status except STATE_COMPLETE. when i set the order status STATE_COMPLETE to make order Complete but it changed to Closed instead of being Complete. Other order States is working fine. The issue only happening when i try to use STATE_COMPLETE.

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $order = $observer->getEvent()->getOrder();
       if($order->getState() != 'complete') {
            $order->setState(\Magento\Sales\Model\Order::STATE_COMPLETE)->setStatus(\Magento\Sales\Model\Order::STATE_COMPLETE);
            $order->save();
       }
}

This is what i'm doing

Can anyone help me out to make order status to "Complete" via observer ?


texts: Magento 2 Hide price for out of stock products in product page

texts:
I saw the same question for magento 1.9 but I don't know how to hide price for out of stock products in product pages for magento 2.2.

I think i should override the 'default.phtml' file in path

  module-catalog/view/base/templates/product/price/amount

but i don't know how.

Could anyone help me?


texts: Magento 2 in how to add the attributes extra more then values in bulk import ? what is th csv formats?

texts:
drop down box values not working  in admin panel side using bulk import..!

products attributes values not working in bulk import in csv files ?


texts: When Should We Use a Repository and Factory in Magento 2?

texts:
I have gone through a couple of tutorials in Magento 2, and this confuses me a little. I can see there are basically two ways by which we can read/write business entities:

Retrieve Data

Using A Factory Approach

$object = $this->myFactory->create();
$object->load($myId);

Using A Repository Approach

$repo   = $this->myRepository();
$object = $repo->getById($myId);

Save Data

Using A Factory Approach

$object = $this->myFactory->create();
$object->load($myId);
$object->setData('something', 'somethingDifferent')->save();

Using A Repository Approach

$repo   = $this->myRepository();
$object = $repo->getById($myId);
$object->setData('something', 'somethingDifferent');
$repo->save($object);

I can also see that, both a repository and a factory class can be injected using dependency injection. This is confusing at least for me.

When should we use a repository approach and a factory approach? What is the best practice we need to follow?


texts:
I have built a custom webapi endpoind with which a customer can get details of their personalised item.

    <route url="/V1/personalizations/get/:personalizationId" method="GET">
        <service class="Me\MyPersonalization\Api\PersonalizationRepositoryInterface" method="get"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

This works great and I can retrieve individual Personalization Objects.

The problem is however, anyone can retrieve anyone elses row as there is no logic to check if the logged in user owns the row.

I can easily do something in the get() method to check....

if ($this->customerSession->getCustomerId() !== $personalization->getCustomerId()) {
    throw new LocalizedException(__("You are not allowed to do this"));
}

But I would need to repeat the logic for every method.

What is the correct way to do custom authentication on webapi?


texts: Magento data migration error: Undefined index: dest

texts:
When I run the migrate:data command I get the following error:

  Notice: Undefined index: dest in
  /var/www/html/magetno/vendor/magento/data-migration-tool/src
  /Migration/Step/Eav/InitialData.php on line 161

Checked the given file and the error comes from the following method:

public function getAttributes($type)
{
    return $this->attributes[$type];
}

I also checked the database of magento 1 site and there is no attribute with code 'dest'

Edit:

Checked on further and found its coming from data-migration-tool/src/Migration/Step/Eav/Data.php line 421

$destinationRecords = $this->initialData->getAttributes('dest');


texts: Magento 2.3 Help removing wasted white space in mobile version

texts:
I am sure this is a simple one to answer, if you go to our site www.terabytecomponents.co.uk and open chrome developer tools to switch to mobile view, there's have 2 divs that are creating a white space between the logo and the search bar.

Would you be kind enough to guide me on how to remove that just for the mobile version?


texts:
Attempting to get a magento 1.14 site setup in Vagrant.

Store seems to be loading correctly, I'm able to view the frontend, admin login screen and n98magerun let's me edit conglfigs, clear caches etc.

I'm getting the dreaded "invalid form key" error when trying to login via the admin.

Here's what I've tried:

made new admin user
set PHP max input vars to 10000
cleared browser cookies etc
tried incognito mode
tried another browser
deleted var/cache and var/session
checked form key is in the login form and is being sent in the request
deleted cookie domain and cookie path config options

These are the typical suggestions and now I'm out of options.


texts: Which events are called when delete product from cart?

texts:
If we click on Add to cart, we can call event checkout_cart_product_add_after , in same way , in cart page, there is delete button to remove Products from cart. what event we need to use onclick that "Delete" button.

I saw this , but i didt got exact event.


texts: How to get bundle product items options html in magento 2.3 programmatically?

texts:
In magento 2.3 i want bundle item options as per in product detail page.How can i get all html of bundle item.
Please suggest any solution


texts: Issue in displaying store multi-select drop down in custom module

texts:
I have a custom community module in which I want to allow store multi-select drop-down.

I am already displaying the drop-down but when I save it's value and then, if I edit the form, I don't see the selected value highlighting though the value is stored correctly in database.

Can anybody let me know, what am I missing in the form ?


texts: Magento2 Creating admin route causes exception

texts:
I've setup a etc/adminhtml/routes.xml for my module with the following code.

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <router name="admin">
        <route id="blog" frontName="blog">
            <module name="Vendor_Blog" before="Magento_Backend" />
        </route>
    </router>
</config>

Which causes the following error in var/report whenever I try to access the admin panel;

Notice: Trying to get property of non-object in /vagrant/public/lib/internal/Magento/Framework/App/Route/Config/Converter.php on line 51"

How do I fix this?


texts:
Running Magento ver. 1.7.0.2

I've got USPS API setup as i'd like, however it does not show up. When I say to show up no matter what, it gives me this front end error:

  This shipping method is currently unavailable. If you would like to ship using this >shipping method, please contact us.

The debug code is this:

2014-09-07T06:07:40+00:00 DEBUG (7): Array
(
    [request] => <?xml version="1.0" encoding="UTF-8"?>
<RateV4Request USERID="981ECCEN4803"><Revision>2</Revision><Package ID="0"><Service>ALL</Service><ZipOrigination>62918 </ZipOrigination><ZipDestination>70125</ZipDestination><Pounds>0</Pounds><Ounces>9.6</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>false</Machinable></Package></RateV4Request>

    [result] => Array
        (
            [error] => Illegal scheme supplied, only alphanumeric characters are permitted
            [code] => 0
        )

    [__pid] => 17709
)

I've triple checked the URL's & username / password for the API.

Has anyone seen an issue like this? I did find it one other place on the network, but he had no answers either: http://goo.gl/fW0TWR


texts: How to override mini-cart default template html file?

texts:
I have Magento 2.2.4 version, And I want to overwrite Magento_Checkout/template/minicart/item/default.html file in my custom module. For this, I created require-jsconfig.js file at below path

  /app/code/Namespace/Module/view/frontend/requirejs-config.js

var config = {
    map: {
        '*': {
          'Magento_Checkout/template/minicart/item/default.html': 'Namespace_Module/template/minicart/item/default.html'
        }
  }
};

removed "var" folder from root and remove "pub/static/frontend" folder and run below command:

php bin/magento setup:static-content:deploy

But mini cart is showing blank.
Can anyone help me to understand my mistake?


texts:
I have car parts products in my M2 store and I need to give my clients availability to filter parts by model of car and year. Each product can be attached to different models/years, in example:

Cabin air filter:

Honda Civic - 2016
Honda Civic - 2017
Honda Civic - 2018
Honda Accord - 2013
Honda Accord - 2014
Honda Accord - 2015
Honda Accord - 2016

If I would have only models, I could add just simple product attribute. But how should I handle this situation, when I have "parent" attribute (model) and "child" attribute (year)?


texts: How to create a search bar that fixes or prevents spelling mistakes?

texts:
So my customers tend to be more so individuals who are not computer literate and often make errors when searching for our products. What is the best way to work out what they're trying to search for and serve it to them? Preferably for free. I'm not asking for module recommendations necessarily if there's code in Magento 2 that I can go in and edit to serve this purpose, that would be most ideal. What is the best way to get this functionality implemented in to my search bar?

EDIT: I'm gonna go with Piyush's replies in the comments, i'm not even allowed to use a third party extension I asked my boss. Instead i'm going to code it based on the github links Piyush left me in reply to this question.


texts: How to update custom customer attribute default value magento 2.X

texts:
I created a custom customer attribute for like payment_term(textarea) it is blank by default, I need to set a default value in this text area,

Blank value causes much problem with custom code.


texts: Magento 2 : Disallow / Disable cart sharing option / funcationlity in magento 2

texts:
Magento 2 : is it possible to disable cart sharing option with multi store setup (Not with multi website setup.).
Cart sharing means: cart should not be share with other store.
ex: if i add a item in store A then on store B my cart should be blank until i don't add a new item on store B.

Inventory management is possible at store level but just want to check that if we can stop cart sharing functionality at store level. Any plugin or any suggestions are welcome.

Any hint will be appreciated.


texts: How can I convert this raw sql segment into a function to use in magento 2?

texts:
This sql segment works fine but meqp validator reports the possible raw sql error 'select `review_id

foreach ($post['cons'] as $key => $value) {
            $array[] = $key;
        }
$inCond = $this->getConnection()->prepareSqlCondition('cons_id', ['in' => $array]);
$sql = 'select `review_id` from (select `review_id`, count(*) as total
        from '.$this->getTable('bss_review_pros_cons').'
        where '. $inCond .'
        group by `review_id`) as bb  where total = ' .count($array);

 $reviewIds = $this->getConnection()->fetchCol($sql);

it will return a review_id array. ex: [215,314].


texts:
Unable to login admin for first time. again i try login admin for second time it is working fine.

I am using the Chrome Browser below is my configuration of admin

http://screencast.com/t/dmaTakZntQ

I tried the below but not working

http://magento.stackexchange.com/questions/26071/magento-1-9-can-t-login-to-admin-panel
http://magento.stackexchange.com/questions/50213/chrome-and-ssl-problem-with-login-and-cart
https://www.yireo.com/tutorials/magento/magento-administration/651-unable-to-login-into-the-magento-backend
http://stackoverflow.com/questions/15491819/magento-admin-login-not-working-in-chrome-but-works-fine-for-firefox


texts: Save uploaded file through custom controller

texts:
My code with file path is as follows:
app/design/frontend/base/default/template/sean_customdocuments/form.phtml
I have a form on this page,

<form action="<?php echo $this->getUrl('customdocuments/index/send') ?>">

Upload Seller's Permit Here:

    <input type="file" name="sellerPermit" id="sellerPermit">
    <input class="submitBtn" type="submit" value="Upload Documents" name="submit">
</form>

That form correctly sends the file to my custom controller
app/code/local/Sean/CustomDocuments/controllers/indexController.php

<?php
class Sean_CustomDocuments_IndexController extends Mage_Core_Controller_Front_Action{
    public function indexAction(){ //this will display the form
        $this->loadLayout();
        $this->_initLayoutMessages('core/session'); //this will allow flash messages
        $this->renderLayout();
    }
    public function sendAction(){ //handles the form submit
        $customer = Mage::getSingleton('customer/session')->getCustomer();
        $post = Mage::app()->getRequest()->getParams();
        $info = pathinfo('/media/custom_documents/seller_permits/' . $post['seller_permit']);
        $ext = $info['extension'];
        $filename = $post['seller_permit'] . $ext;

        $target = '/media/custom_documents/seller_permits' . $filename;
        move_uploaded_file($post['sellerPermit'], $target);

        Mage::getSingleton('core/session')->addSuccess($this->__('Your Documents have been updated!'));//add success message.
        $this->_redirect('*/*');
    }
}

media is on the same directory level as app
I want to save the files customers are uploading through my form to
media/custom_documents/seller_permits

But it's not working does anyone have any idea why?
The correct stuff is getting to the controller I'm just having trouble saving it as a file to my target directory.


texts: Include link together delivery option in checkout - Magento

texts:
i want include a link with information in popup together to the delivery option in checkout.
When in Magento you are in checkout and you have choose delivery option (shipping methods), i want in one delivery option put a link with the text (more info this option) per example.
Where file is for include code?
Manu thanks for advance


texts: Anyone could give me some tips how I upgrade Magento 1.5 to 1.9? I am new in Magento and I didn't see any upgrade option in my Magento backend.


texts:
For Magento (1.9) how to set the value to the Magento form.

  $fieldset->addField('country_code', 'text', array(
          'label'     => Mage::helper('catalog')->__('Title3'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'country_code',
          'style'   => "border:10px",
          'value'  => 'hello !!',
          'disabled' => false,
          'readonly' => true,
        ));

I set the value is hello !! but it is not working.


texts: Magento 2 - after upgrading EC2 instance Magento crashes during every product save with CPU at 100%

texts:
I have a site in development using Magento (2.2.5) on a EC2 instance with only one CPU and everything was working fine. I then upgraded the EC2 instance to 4 CPUs (standard instance upgrade on AWS) for production. Suddenly every time I save a product on the backend (simple and basic product with no options) the server crashes as Apache takes 100% of the CPU (as witnessed with the "top" command).

What can be causing this issue? All that happened was the server was stopped, upgraded and restarted.

I have tried restarting mysql, apache, varnish and cronjobs but nothing helped. I have also flushed the cache and reindexed.

What can be causing this issue?

Please help.


texts:
I'm getting some error from Magento MySQL database. I tried to fix it from "Magento Database Repair Tool" , unfortunately it shows "reference DB doesn't seem to be a valid Magento database". Please tell me, how can I fix it.

Please Help.


texts: how to call resource model methods in Block.php files or phtml files

texts: I could not call resource model function display records in block/dotnet.php


texts: give access to magento admin panel " manage products" without editing

texts:
we want to create a new user and role to access only "manage products section"

but we don't want to give access with edit the products information and attributes.

we just want to give access only to see the product and search the products.

please help me how to do it?

thanks in advance


texts: Magento 2.2.5 Override tracking.phtml at vendor/magento/module-shipping/view/adminhtml/templates/order

texts:
Has someone an idea on how to override this template?

I have tried the following without any success:

In app/code/Custom/Shipping/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'adminhtml/Custom/Shipping',
    __DIR__
);

In app/code/Custom/Shipping/etc/module.xml

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

In app/code/Custom/Shipping/view/adminhtml/layout/sales_order_invoice_new.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">
    <body>
        <referenceBlock name="form">
            <block class="Magento\Shipping\Block\Adminhtml\Order\Tracking\Invoice" name="tracking" template="Custom_Shipping::order/tracking.phtml"/>
        </referenceBlock>
    </body>
</page>

In app/code/Custom/Shipping/view/adminhtml/templates/order/tracking.phtml I'd adjust the code that comes originally from tracking.phtml in the vendor map


texts: Editing the layout of additional product info in sales email?

texts:
I have an individual block in app/design/frontend/base/default/layout/sales.xml

<block type="core/text_list" name="additional.product.info" />

I want to style it's output like so ("PHP" would be floated right):

Is this achievable and if so, how?


texts: Do I add simple products (associated with configurables) to categories?

texts:
Might be a silly question but I was wondering if there is a need for adding simples (that are not visible individually) to a category in which their respective configurable is added already.

So, the question is two-fold:
1. Is it needed for simples to be added to categories (where they are not shown individually?
2. If not, what is the best practise and why?

Cheers


texts: I want display product price dynamically based on change quantity in Magento 2

texts:
I want display product price dynamically based on change quantity in magento2 for product detail page.
I want reflect product prices based on quantity increment or decrement when we click on plus or minus button.
i want reflected value based on change quantity in extra div below add to cart button. how to do


texts: How to get product custom attribute by using sku or ID in Magento 2?

texts:
I have created a custom attribute for product in Magento 2.
But how to get that value by sku or id in Magento 2 ?
I have got the product id by
$product = $this->productRepository->get($productsku);
$id = $product->getEntityId();

how to get custom attribute value if my attribute name is 'my_custom_attribute'


texts: move left product gallery on product page

texts: How to move the slider to the left of the main picture?


texts:
Magento 2.2.3
Theme: Luma

My homepage uses layout: 2 column with left bar. I want to hide the image block ( CMS static block ) or whole sidebar container referenceContainer name="sidebar.main" from home page when the page enters mobile mode ( width < 768px ). How can I achieve that?


texts: Magento 2 : How to Fetch Cms Block Count

texts:
I want to fetch CMS Block count using identifiers in phtml.

How is it possible?


texts: What happen when two module override same file?

texts:
I am coming from Wordpress development & now I started Magento module development.

I am following this tutorial.

I am just trying to add social sharing buttons to the product edit page.

According to their article,

  Now go to the root directory of your Magento and navigate to
  vendor/magento/module-catalog/view/frontend/templates/product/view,
  and find the addtocart.phtml  file.

  Copy this file to your module in
  app/code/Cloudways/Mymodule/view/frontend/templates/catalog/product/view

So you can see that we are going to override the addtocart.phtml. So my question is, what happens another module override same file? Loss my changes?


texts: Configurable Swatches is impacting Performance of the website drastically

texts:
We are using Magento 1.9.1.4 CE and struggling to improvise the performance of the web pages primarily on the Checkout Page and Shopping Cart.

When analyzing these web pages in terms of performance it appears that:

Mage_ConfigurableSwatches_Helper_Mediafallback::attachConfigurableProductChildrenAttributeMapping

Mage_ConfigurableSwatches_Model_Resource_Catalog_Product_Attribute_Super_Collection::_loadOptionLabels

Cm_RedisSession_Model_Session::read

is taking too much time, as a result, the page is loading quite slow. Could you please advise us on the following:

Can we disable the configurable swatches on the checkout page / Shopping Cart page? Does it mean that only image will not be displayed on the Checkout page (Configurable Product)? What are the repercussions of this step?

What can be done for Redis Session? We are using FPC + Redis. Is it a configuration issue? What changes needs to be done to improvise the speed?


texts: Getting an error "No date part in '' found." while creating an product programatically

texts:
I am trying to create an virtual product programatically by using below code.When I execute this script from root of the store I am getting an error :

  No date part in '' found.

require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$product = Mage::getModel('catalog/product');

$product
->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array
->setAttributeSetId(4) //ID of a attribute set named 'default'
->setTypeId('virtual') //product type
->setCreatedAt(strtotime('now')) //product creation time
->setSku('test') //SKU
->setName('Test Product') //product name
->setWeight(4.0000)
->setStatus(1) //product status (1 - enabled, 2 - disabled)
->setTaxClassId(0) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE) //catalog and search visibility
->setPrice(0) //price in form 11.22
->setCost(0) //price in form 11.22
->setDescription('This is a long description')
->setShortDescription('This is a short description')

->setStockData(array(
                   'use_config_manage_stock' => 0, //'Use config settings' checkbox
                   'manage_stock'=>0, //manage stock
                   'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
                   'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart
                   'is_in_stock' => 1, //Stock Availability
                   'qty' => 999 //qty
               )
);

 try{
    $product->save();

  }catch(Exception $e){
    Mage::log($e->getMessage());
  }

Thank you in advance.


texts: How to enable extensions through terminal?

texts:
Is there a way to enable and disable extensions in version 1.x via the command line?

How can I enable an extension through terminal?

What is the command?


texts: Override local extension that overrides core

texts:
<global>
  <models>
    <sales>
      <rewrite>
      <order_pdf_invoice>Local_Extension_Model_Sales_Order_Pdf_Invoice</order_pdf_invoice>
      </rewrite>
    </sales>
  </models>
</global>

This is in the local extension that Im trying to override.

So in my /etc/extension.xml file I put that it depends on Local_Extension, I also put it in my etc/config.xml file I then used the exact same rewrite as they did in their config.xml but using my path and when I look at the Modules conflict detector it says that my class overrode the class, but it is not being used.

In that same Modules Conflict Detector it shows the initial class being

Mage_Sales_Model_Order_Pdf_Invoice

and the rewrites are

MyCompany_InvoicePdf_Model_Sales_Order_Pdf_Invoice
Local_Extension_Model_Sales_Order_Pdf_Invoice

the Local_Extension is green which means it's being used and MyCompany is red saying "Red class name means that probably there is conflict. Initial class has been overwritten by this class, but this class is not used.

You should check if this class doesn't contain any important methods or changes, which should be used."

In my class file Invoice.php the first line is:

  class MyCompany_InvoicePdf_Model_Sales_Order_Pdf_Invoice extends

  Local_Extension_Model_Sales_Order_Pdf_Invoice

But I must be missing something...? Any help!? Thanks! :)


texts: Magento 2: put all CMS pages in the top bar

texts:
I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank.

By default, it seems, Magento displays links to the product categories (and subcategories) in the top bar. I need to display only the CMS (static) pages there.

The code from default.xml that displays the top bar is:

<container name="navbar-collapse" htmlTag="div" htmlClass="collapse navbar-collapse" htmlId="wg-navbar-collapse">
  <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml" ttl="3600" before="-">
     <arguments>
       <argument name="parent_item_class" xsi:type="string">dropdown</argument>
       <argument name="submenu_class" xsi:type="string">dropdown-menu</argument>
     </arguments>
  </block>
</container>

Replacing catalog.topnav with cms.topnav did not produce any change in the frontend. I could not find a way to do that through the admin either.

How must I do it?

Alternatively, is there a free plugin for this functionality?

Thank you!


texts: Magento2 can't call custom phtml fail in CMS Static Block

texts:
I have tried many ways to call the custom phtml file in Static Block but none of them seems to work.

My file is located - app/design/frontend/Magento/MyTheme/Magento_Theme/extra/test_view.phtml

How i call the file in CMS Static Block -

{{block class="Magento\Framework\View\Element\Template" name="test_view" template="Magento_Theme::extra/test_view.phtml"}}

And when i add the static block to main content area, it just displays the code thats above. Am i doing something wrong?


texts: Price don't change on product page when customer group change (and price different in this group)

texts:
I have a strange behavior on a Magento 2.2.10 (but may be it's the same on other version)

I have created 2 more customers groups (G1 and G2), each one with a set of products prices different from normal prices.

The customer fill is cart, then subscribe, and there with a custom field I can change their group on certain conditions.

If condition is ok, the customer changes group (for example G1) and prices (in a customer_save_before event).

The cart is updated, the new prices are here, it's working.

BUT !

But if they come back to the product page, the price is still the normal price.

If I logout and then login back (on an incognito window), and go to the product page, now I have the good prices. But if again I change the customer group (to G2 for example), I still have G1 prices on the product I've viewed.

I guess there's a customer cache issue here, but anyone have an idea how to work around this ? I want my caches on.

Thanks.


texts: How to open new tab on button click and send post data?

texts: I've been trying to make my button open a new tab, the same way my form is doing but I've discovered that window.open() doesn't work on POST requests. SO, is there any other way I can make my button open a new tab instead of opening in the parent tab?


texts: Delete Product Images For Products That Are Disabled

texts:
Is there a way to delete all images for products that are set as disabled?

It's just a lot of my products that are disabled are taking my storage space up on my server.

I'd just like to be able to cron a PHP script every week or so however I'm unsure what this script might actually look like?

Any idea if this is possible?


texts: How to get instance of Adapter Product in Magento 2.1.x

texts:
In Magento 1.x it uses

"instanceof Mage_Catalog_Model_Convert_Adapter_Product"

How can I do this with Magento 2?


texts: Magento 2 When a user logs in, can we redirect to homepage?

texts: I would like to have the user redirected to homepage instead of dashboard as soon as he logs in.


texts: I've installed a news extension but I don't succed to customize layout. For all other pages, I've the category and inside I call the cms static block to uniform all the layout.. Now instead with this extension I've its page that seems to have the standard magento layuot with the pool on the right. Where can i modify this layout or how I can use the cms block ?


texts: Is there a valid reason two orders would have the same quote id?

texts:
We have been having trouble with customers duplicating their orders. Finding the cause is a subject for a different question. We are using a module we bought that overrides default cart behavior a bit.

I noticed that the duplicated orders have the same quote id. I was thinking that in the custom saveOrderAction() method, I could detect if an order with that quote id already exists. I would assume there is no reason someone would buy the same cart twice. I don't want to cause false positives though.

Is there a valid reason that two orders in the sales_flat_order table would have the same value for the column quote_id?


texts:
Dears,
I have a xml file in the vendor directory:
vendor/the_vendor/the_module/view/frontend/layout/the_file.xml

I know that I should never make any change in this directory as it may be overrided by composer.
I also know that I should create the the_file.xml in my theme.
my theme path is:
app/design/frontend/the_Vendor/My_Theme/

Could you please let me know where the the_file.xml should be created (the exact path) in order to override the vendor xml file ?


texts: Magento2.3: How to collect the data by time?

texts:
I want to collect the records from 10PM to 5AM of wishlist data. I have already created a module and not sure how to filter the records by this timeframe.

The wishlist table contains a field called Updated at. Now how can I use this field to filter the records?

Can anyone please guide me on that?

Any help will be appreciated.

Error:

Fatal error: Uncaught Error: Call to undefined function thimma\mymodule\Model\now() in /var/www/html/thimmajan3/thimma/app/code/thimma/mymodule/Model/Salesorder.php:28 Stack trace: #0 /var/www/html/thimmajan3/thimma/app/code/thimma/mymodule/Controller/Salesorder/Export.php(78): thimma\mymodule\Model\Salesorder->getAllTransactionaldata() #1 /var/www/html/thimmajan3/thimma/vendor/magento/framework/App/Action/Action.php(108): thimma\mymodule\Controller\Salesorder\Export->execute() #2 /var/www/html/thimmajan3/thimma/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #3 /var/www/html/thimmajan3/thimma/vendor/magento/framework/Interception/Interceptor.php(138): thimma\mymodule\Controller\Salesorder\Export\Interceptor->___callParent('dispatch', Array) #4 /var/www/html/thimmajan3/thimma/vendor/magento/module-customer-segment/Model/App/Action/ContextPlugin.php(81): Butt in /var/www/html/thimmajan3/thimma/app/code/thimma/mymodule/Model/Salesorder.php on line 28


texts:
Element 'referenceBlock', attribute 'cacheable': The attribute 'cacheable' is not allowed.

when I click checkout button that error occurs
My magento version is 2.3.5 so that must not be the problem
https://i.imgur.com/WG1D93U.png
how may I fix?


texts: Order item quantity increased instead of updated

texts:
When I change the quantity of a cart item from the product "configure" page (.../checkout/cart/configure/id/...), the order item quantity is increased with the quantity, instead of updated.

i.e. if I hit the Edit link of a product from my cart, set the quantity to 2 and hit the "Update Cart" button, I end up with a quantity of 3 for this product, instead of 2.

Any helper please ?


texts: Wishlist.js calling after span append Magento2

texts: The issue I am facing is that in the file link.html, the span is getting called even if the value is null for the counter. This happens for a fraction of second, but after some time the span gets removed.


texts:
We are building a website which somewhat acts like a marketplace. The website sells bags which are manufactured in different countries. The website owner acts as a mediator between the customer and the manufacturer

What i need is when a product is bought an email should be fired to the manufacturer of the bag. The email includes name of the product, its buyer, shipping address and contact information of the buyer.

If more than one product is bought different email should be fired to the manufacturer of those particular product.

Is there any extension available in the market which supports such a functionality. I tried to search but all i came across was marketplaces which our client can't afford.

Another way i thought was to enter a field for each product wherein the email of manufacturer is entered. When a prouduct is bought on checkout_process_complete event the email should be fired. As i am not that pro in magento custom extension building can anyone suggest me which way should i go ?

If i go for building a custom module from where i can start from ?

Any help will be appreciated

Thanks


texts: Magento2.3.5 - Fastest way to check if product got related products

texts:
At the moment we use the following code on the product page, to check If the product got related products or not. But this is quite a slow method and slows the product page down with more than 0.5 sec.
Is there a faster way to check If the product got related products?
CODE:
<?php $relatedProduct = $product->getRelatedProducts(); if (!empty($relatedProduct)):?>
   GOT PRODUCTS
<?php endif;?>


texts: Magento 2 category list page - add template - get product attribute

texts:
I want to add a custom template inside the category list page.

Therefore I added the following inside my catalog_category_view.xml;

<block class="Magento\Catalog\Block\Category\View" name="category.products" template="Magento_Catalog::category/products.phtml">
   <block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">

     <block class="Magento\Catalog\Block\Product\ListProduct" name="product-specs" template="Magento_Catalog::product/list/specs_list.phtml" />

</block>
</block>

Inside the list.phtml template I load this template using;

<?= $block->getChildHtml('product-specs') ?>

And inside the custom template I loaded the following;

<?php
$_productCollection = $block->getLoadedProductCollection();
$_helper = $this->helper('Magento\Catalog\Helper\Output')
$_product = $block->getProduct();
?>

But I still can not get any product attribute data, so for example the following line gives me a error. <?php echo $_product->getName();?>

How can I change this and get the productdata?

UPDATE:

We achieve this in M1 by the following line in the list.phtml template;

<?php $this->getChild('product-specs')->setProduct($_product);?>
<?php echo $this->getChildHtml('product-specs', false); ?>

But it seems that we can not use this in the same way in M2. Any ideas how to solve this?


texts:
i need to extract the list of all orders executed in the last 24 hours, from now.
I have a code almost working but not every orders is processing.
The cronjob runs smoothly but i miss the last 3/4 orders. Maybe i have missed something with the date?
public function exportOrders($timestamp)
   {
       $date = (new \DateTime())->modify('-24 hours');
       $date2 = (new \DateTime())->modify('now');

       $searchCriteria = $this->searchCriteriaBuilder->create()
           ->addFilter(
               'created_at',
               $date->format('Y-m-d h:i:s'),
               'gt'
           )->addFilter(
               'created_at',
               $date2->format('Y-m-d h:i:s'),
               'lteq'
               )
           ->addFilter('status', ['processing'], 'in')
           ->create();

       $orders = $this->orderRepository->getList($searchCriteria);

       /**
        * @var $order OrderInterface
        */
       $ordersData =[];
       $itemsData =[];
       if ($orders->getTotalCount() > 0) {
           foreach ($orders->getItems() as $order) {
               $items = $order->getAllItems();
               $postCode = $order->getShippingAddress()->getPostcode();
               $method = $order->getShippingAddress()->getShippingMethod();
               try {
                   $zip = $this->validateZipCode($postCode);

                   if (is_array($zip)) {
                       if (isset($zip['zipitem_id'])) {
                           $zipObject = $this->zipcode->load($zip['zipitem_id']);
                           $method = $zipObject->getData('area');
                       }
                   }
               } catch (\Exception $e) {
                   var_dump($e->getMessage());
               }

               $ordersData[] = [
                   'entity_id c(20)' => $order->getEntityId(),
                   'coupon_code c(20)' => $order->getCouponCode() ?? "NA",
                   'shipping_description c(50)' => $order->getShippingDescription() ?? "nA",
                   'customer_id c(20)' => $order->getCustomerId() ?? "NA",
                   'grand_total c(20)' => $order->getBaseGrandTotal() ?? 0,
                   'shipping_amount c(20)' => $order->getBaseShippingAmount() ?? 0,
                   'shipping_tax_amount c(20)' => $order->getBaseShippingTaxAmount() ?? 0,
                   'discount_amount c(20)' => $order->getDiscountAmount() ?? 0,
                   'customer_is_guest c(1)' => $order->getCustomerIsGuest() ?? 0,
                   'billing_address_id c(20)' => $order->getBillingAddress()->getEntityId() ?? 0,
                   'increment_id c(20)' => $order->getIncrementId() ?? 0,


texts: Rest API showing Error "The consumer isn't authorized to access %resources."

texts:
I am calling Rest API in Magento2.3.4 in postman, gives error:
{
    "message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "Magento_Sales::actions_view"
    }
}

and the same error for Customer Rest API.
I am using Administrator user for calling all Rest API's with all permission assigned also have checked it double from its Database Authorization table.
All these API's working on another store with same Magento Version.
I have tried as suggested here:
https://community.magento.com/t5/Magento-2-x-Technical-Issues/REST-API-The-consumer-isn-t-authorized-to-access-resources-2-3-1/td-p/133545#lineardisplaymessageviewwrapper_3
Any idea or help would be appreciated.


texts: sales_order_place_after not firing for admin-created orders

texts:
I have a simple custom module that sends a separate email to an admin user once an order has been placed (email uses a different template). This email is supposed to work for orders placed from the frontend or the backend.

The event gets triggered when a frontend order is placed, but not when a backend order one is placed, although the event is global.

Here is my config.xml

<global>
    <events>
        <sales_order_place_after>
            <observers>
                <adminneworderemail_order_place>
                    <type>singleton</type>
                    <class>adminneworderemail/observer</class>
                    <method>orderPlace</method>
                </adminneworderemail_order_place>
            </observers>
        </sales_order_place_after>
    </events>
</global>

And the Observer function being triggered:

public function orderPlace($observer){
    $order = $observer->getData('order');
    $orderId = $order->getId();
    $this->sendAdminOrderNotification($orderId);
}

Does anyone have any idea what I am doing wrong? I am using magento 1.9.3.1


texts:
I have a question. In checkout page when user put a discount code, the page refresh change language.
Thank you


texts: How to display stock quantity only for simple products?

texts:
I want to display stock quantity only for simple products. For that, I added some code and it's working fine for simple products. But the thing is it's also showing quantity for other types of products like configurable.

here is the code I added
app/code/Smartwave/Porto/Helper/Data.php

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Smartwave\Porto\Helper;

use Magento\Framework\Registry;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{

    protected $_objectManager;
    private $_registry;
    protected $_filterProvider;
    private $_checkedPurchaseCode;
    private $_messageManager;
    protected $_configFactory;

    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry,
        Registry $registry
    ) {
        $this->stockRegistry = $stockRegistry;
        parent::__construct($context);
    }

     public function getStockQty($product)
    {
        return $this->stockRegistry->getStockStatus($product->getId(), $product->getStore()->getWebsiteId())->getQty();
    }
}

app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/type/default.phtml

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php /* @var $block \Magento\Catalog\Block\Product\View\AbstractView */?>
<?php $_product = $block->getProduct() ?>

<?php if ($block->displayProductStockStatus()): ?>

    <?php if ($_product->isAvailable()): ?>
        <div class="stock available" title="<?php /* @escapeNotVerified */ echo __('Availability') ?>">
            <?php /* @escapeNotVerified */ echo __('Availability:') ?>
            <?php echo $this->helper('Smartwave\Porto\Helper\Data')->getStockQty($_product);?>

    <?php else: ?>
        <div class="stock unavailable" title="<?php /* @escapeNotVerified */ echo __('Availability') ?>">
            <?php /* @escapeNotVerified */ echo __('Availability:') ?>
            <?php /* @escapeNotVerified */ echo __('Out of stock') ?>

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


texts: How can I put shipped items back in stock when returned by a customer?

texts:
Consider the following scenario:

Customer orders 3 items
Admin creates invoice and shipment, ships items out
Customer returns 1 of the 3 items

This all happens before the invoice is paid. So now we have to generate a new invoice. No problem, just cancel the existing (unpaid) invoice and create a new one for just the two items.

But I can't find a way to put the returned items back in stock right (except manually).

When the return happens after the invoice is paid, restocking the returned items is no problem, because when creating the Credit Memo I can tell Magento to put the refunded items back in stock. But I can't create a Credit Memo for an unpaid order...

What's the workaround here? Does the admin really have to restock the items manually, or am I overlooking something?


texts: AheadWorks - Follow Up Email extension review event

texts:
I'm using Follow Up Email extension from AheadWorks.
I wrote a rule to send a notification email when a user has submitted a review.
What I'd want to achieve is to state name and sku of product for which review has been submitted.
Unfortunately
    {{var product.getName()}}
and
    {{var product.getSku()}}
do not work.
So I'm wondering if it's possible to get the product related to review in template variables.


texts: Amasty Extension - Sales Reps and Dealers - Custom Attributes

texts:
Hey guys I'm using this extension:
https://amasty.com/sales-reps-and-dealers.html

It works beautifully but I want to make some adjustments.  Essentially it creates sales reps/dealers that can have their own customers under them.
Here is a visual diagram:

                               Our Awesome Company
                              /        |         \
                           Dealer1     |        Dealer2
                             /         |           \
                        Customers1    Customers2    Customers3

Our company can see all customers from groups 1,2,3.

Dealer1 can only see Customers1 and Dealer2 can only see Customers3

From what I know about SQL the customers must be linked in some way to their dealers, how would I go about checking who their dealers are?  I'm hoping I can find their relation in a SQL search and eventually figure out a way to call getData('something') to see a customer's dealer.

Let me know if I can clarify my question in anyway!  I tried to explain everything in a way where people without this extension could help out too.


texts: Magento 2 how to move active cart price rules to another store

texts:
I want to move active cart price rules to another store. How can I move those?
How can I import export those?
Thanks In Advance!


texts:
I have tried to create a new tax rule for my site, but there seems to be no Australian Options for me to pick in relation to our 10% GST.

Do I need to add something to get this to work?


texts: Get Category IDs for Product via Service Contract / API

texts:
In Magento 2, is there a way to get the assigned category ids for a given product, via Service Contracts?

The CategoryLinkManagementInterface API interface only has one method that returns the assigned products for a given category ID, but I need it the other way around.


texts: magento 2 Rest api to add simple and bundle products

texts:
I am using rest API to add simple and bundle product

Please see the below code

$productData = '{
  "product": {
      "sku": "TESTPRD002",
      "name": "Women`s Running - Pure Boost X Shoes",
      "attribute_set_id": 15,
      "price": 84,
      "status": 1,
      "visibility": 4,
      "type_id": "simple",
      "created_at": "2016-12-16 15:20:55",
      "updated_at": "2016-12-16 15:20:23",
      "weight": 1,
      "extension_attributes": {
        "stock_item": {
          "item_id": 1,
          "stock_id": 1,
          "qty": 20,
          "is_in_stock": true,
          "is_qty_decimal": false
        }
      },
      "product_links": [],
      "options": [],
      "tier_prices": [],
      "custom_attributes": [
        {
          "attribute_code": "description",
          "value": "
Lightweight and sleek, these women`s running shoes are fueled by boost™ energy. The low-profile runners blend an energy-returning boost™ midsole with a STRETCHWEB outsole for a cushioned ride with terrific ground-feel. They feature a breathable mesh upper with a sock-like fit that offers all-around support. With a full boost™ midsole that keeps every stride charged with light, fast energy, the shoe has an upper that hovers over a free-floating arch.
"
        },
        {
          "attribute_code": "short_description",
          "value": "
PURE BOOST X SHOES

NATURAL RUNNING SHOES WITH ARCH SUPPORT.
"
        },
        {
          "attribute_code": "meta_title",
          "value": "PURE BOOST X SHOES"
        },
        {
          "attribute_code": "meta_keyword",
          "value": "boost X, running, shoes, adidas"
        },
        {
          "attribute_code": "meta_description",
          "value": "NATURAL RUNNING SHOES WITH ARCH SUPPORT."
        },
        {
          "attribute_code": "category_ids",
          "value": [
            "44"
          ]
        },
        {
          "attribute_code": "url_key",
          "value": "womens-running-pure-boost-x-shoes"
        },
        {
          "attribute_code": "tax_class_id",
          "value": "1"
        },
        {
          "attribute_code": "remarks",
          "value": "Lorem ipsum.."
        }
      ]
  },
  "saveOptions": true
}';
//echo $productData;
$product_url ='http://local.marketplace-release.com/marketplace/rest/V1/products/';

$setHaders = array('Content-Type:application/json','Authorization:Bearer '.$adminToken);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $product_url);
curl_setopt($ch,CURLOPT_POSTFIELDS, $productData);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, $setHaders);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);

  Result : "{"message":"Unable to save product"}"

Please help me..


texts: Developer mode not working correctly when set via cli

texts:
I decided to switch my testing area from production to development for a quick fiddle and barely any of the static files were generated once visiting site after setting mode with below command.

bin/magento deploy:mode:set developer

This has always worked in the past however today has been another story. After loads of files just not being generated and seeing lots of 404 for js / css files and require js errors now I just seem to get this:

Unable to retrieve deployment version of static files from the file system.

OR

Warning: include(/home/sites/magento/testing_html/var/view_preprocessed/pub/static/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /home/sites/magento/testing_html/vendor/magento/framework/View/Result/Page.php on line 326

This may just be a permissions issue but have set various ways and nothing seems to work great.

After a couple hours of fiddling with permissions and flushing / disabling cache. Running setup:upgrade and anything else I could think if I discovered that developer mode now only seems to work if set with the .htaccess.

SetEnv MAGE_MODE developer

Not ideal so just wondering if anyone knows a solution or why this might be occurring like this?


texts: How to add pager limit in core file in magento2?

texts:
I want to add some condition for pager in order collection.

In Magento\Sales\Block\Order\History.php;

protected function _prepareLayout()
    {
        parent::_prepareLayout();
        if ($this->getOrders()) {
            $pager = $this->getLayout()->createBlock(
                \Magento\Theme\Block\Html\Pager::class,
                'sales.order.history.pager'
            )->setCollection(
                $this->getOrders()
            );
            $this->setChild('pager', $pager);
            $this->getOrders()->load();
        }
        return $this;
    }

I need to add this in pager

$pager = $this->getLayout()->createBlock(
                    \Magento\Theme\Block\Html\Pager::class,
                    'sales.order.history.pager'
                ) ->setAvailableLimit(array(4 => 4))
                  ->setShowPerPage(false)
                  ->setCollection(
                        $this->getOrders()
                    );

So, I have override this block file like

protected function _prepareLayout()
    {
        parent::_prepareLayout();
        if ($this->getOrders()) {
            $pager = $this->getLayout()->createBlock(
                \Magento\Theme\Block\Html\Pager::class,
                'sales.order.history.pager'
            )->setAvailableLimit(array(4 => 4))
                ->setShowPerPage(false)
                ->setCollection(
                $this->getOrders()
            );
            $this->setChild('pager', $pager);
            $this->getOrders()->load();
        }
        return $this;
    }

  Exception #0 (Magento\Framework\Exception\LocalizedException): An
  element with a "sales.order.history.pager" ID already exists.

How to do this.

Thanks.


texts: How do you override a translation for a specific module in Magento 2?

texts:
I need to change the text on an item in a 3rd party extension from "Apply" to "Redeem".  Since Apply is used in other modules as well I want to make sure to only affect instance of "apply" in the module specifically.

In Magento 1 this could be done using the line below in the theme's translation file...

"Module_Name::Apply","Redeem"

I tried this in Magento 2 and it does not seem to work and I didn't see any mention of an alternative in the Magento Translate Docs. Is there a way to accomplish this in Magento 2?


texts: override knockout html template file in theme

texts:
I need to add a class to the cart summary table caption.

I want to hide the caption by addding the class sr-only (bootstrap):

<caption class="table-caption sr-only" data-bind="text: $t('Total')"></caption>

The code is in the file ../Magento/Checkout/view/frontend/web/template/cart/totals.html

I created my own base template and <theme> is a child of this (aka I don't extend from empty or luma). So I override the file in app/design/frontend/<vendor>/<theme>/Magento_Checkout/web/template/cart/totals.html

I deployed static content, flushed the cache (in the browser too).
So basically I did everything from this checked answer: https://magento.stackexchange.com/a/138238/42007
But my added class does not appear.

What did I miss?


texts: Problem with rendering address field on profile page

texts: I have a problem like in attachment. I don't know why address isn't rendering. Please help me how to debug this.


texts:
I have modified customer address templates to include some custom address attributes I have added and this works great. However as part of the modification I need to include some static text that needs to be translated to the right language (presumably website language).

I know I can use {{trans "text here"}} directive in transactional email templates to translate parts of the template text. However in address templates this does not work - it simply outputs the directive verbatim (i.e. the entire directive not just the text inside the directive)

What is the proper way to translate an address template?


texts:
I am new to magento and try to make magento extension, Issue is my extension config.xml file in etc directory is conflict with other extension.

First extension config.xml file data

<?xml version="1.0"?>
  <config>
     <modules>
        <Pfay_Test>
          <version>1.0.0</version>
        </Pfay_Test>
     </modules>
     <frontend>
           <routers>
              <routeurfrontend>
                  <use>standard</use>
                  <args>
                     <module>Pfay_Test</module>
                     <frontName>test</frontName>
                  </args>
               </routeurfrontend>
           </routers>
           <layout>
               <updates>
                    <test>
                         <file>test.xml</file>
                     </test>
               </updates>
           </layout>
    </frontend>
      <global>
         <blocks>
             <test>
                  <class>Pfay_Test_Block</class>
             </test>
          </blocks>
          <models>
            <test>
                 <class>Pfay_Test_Model</class>
                 <resourceModel>test_mysql4</resourceModel>
             </test>
            <test_mysql4>
                 <class>Pfay_Test_Model_Mysql4</class>
                 <entities>
                     <test>

pfay_test

                     </test>
                  </entities>
            </test_mysql4>
           </models>

          <resources>

            <test_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </test_write>

           <test_read>
              <connection>
                 <use>core_read</use>
              </connection>
           </test_read>
        </resources>

    </global>
</config>

Second extenshion config.xml file data

<?xml version="1.0"?>
  <config>
     <modules>
        <Rsignal_Contact>
          <version>1.0.0</version>
        </Rsignal_Contact>
     </modules>
     <frontend>
       <routers>
          <routeurfrontend>
              <use>standard</use>
              <args>
                 <module>Rsignal_Contact</module>
                 <frontName>contact</frontName>
              </args>
           </routeurfrontend>
       </routers>
    </frontend>
</config>

while i try to make 2nd config.xml then first extension stop working. please help me and guide me how i solve this problem.

Thank You


texts: Magento2: why all my post request to my controller been forward

texts:
I'm developing a module for the payment method.

So I need to revise post requests with pay results but all Post requests send to my controller been forward to the home page.

If request type is Get, my controller can revise request.

I try to sent Post request to magento2 another URL, still been forward to the home page.