Here at
Beckin, my web development studio, I put a lot of time into writing how to guides / articles that make tech easier to understand.
If you found one useful, consider
buying me a coffee ☕ — it’s a small way to say thanks and it motivates me to keep sharing.
I decided to write this post since there is not much documentation related to getting the customer group id for a coupon. The best way to achieve this is to grab the customer group id using the function getCustomerGroupIds(). Below is a simple and fast way to get this using the salesrule/rule model. Now you…
When creating forms for Magento, it is helpful to know the different types of built-in fields that can be used while creating a form. The below examples can be used to create an admin form by extending the Mage_Adminhtml_Block_Widget_Form block. Hidden Field Text Time Textarea Submit Select Example 1 Example 2 Radio Example 1 Example…
If you have an array that contains a hundred different values, you may be wondering how you can check if that array contains a certain string. As you may already know, you can use the foreach() function to echo out each value contained inside the array. But let’s imagine that we simply want to execute…
If you need to insert a comma separated string into a variable you can accomplish this with the following code. Let’s take a look at our string. We can insert our string into an array by simply using the explode() function. Now if we use the print_r() function we can view our array. We should…
If you find that you have a string containing commas and need to remove them, you can do the following. This comes up a lot when you are cleaning up CSV values, normalizing phone numbers, or turning a list of IDs into a format that can be used in a database query or API call.…